Panel Interface Board  1
inszt_commands.c
Go to the documentation of this file.
1 /*
2 C TESTBED VERSION : 9.7.2
3 FILE UNDER TEST : "C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\commands.c"
4 DATE OF ANALYSIS : Fri Aug 28 06:51:21 2020
5 */
6 /**************************************************************************************/
24 /**************************************************************************************/
25 /**************************************************************************************/
26 /* Section: Included Files */
27 /**************************************************************************************/
28 /**************************************************************************************/
29 #define QQQdialect MPLABX
30 #undef QQQ146
31 #undef QQQ148
32 #undef QQQbndchk
33 #undef QQQ294
34 #undef QQQEMBEDDEDICE
35  /* Note: for BITMAP execution histories QQQthreaded is not defined */
36 #undef QQQthreaded
37 #undef QQQdo178b
38 #undef QQQfixbra
39 #define QQQswitch3
40 #undef QQQternary
41 #define QQQswitch
42 #undef QQQmacrof
43 #undef QQQMULTIPROCESSEXH
44 #undef QQFLUSH
45 #undef QQNEWBS
46 #define qqqMaxBranchDepth 20
47 #define QQQstructbitmap
48  static int qqqqbmselwidth = 32 ;
49  static int zzfileid = 65;
50 #define QQQnumfil 23
51 #undef QQQALGONE
52 #undef QQQVCLFLG
53 #undef QQQFORKFL
54 #undef QQQIADDRF
55 #undef QQQRTI
56 #undef QQQPERFA
57 #undef QQQADRMOD
58 #undef QQQDCAPFL
59 #undef QQQTEMPLATEONLY
60 #define QQQNOATEXIT
61 #define QQQUPLOADATEND
62 #define QQQNOSTDIO
63 #undef QQQASHLINGVITRA
64 #define QQQBITMAP
65  #define qqqbitmapint unsigned int
66 #undef QQQBITMAPMCDC
67 #undef QQQTIC2XSERIALIO
68 #undef QQQTIC2XFLASH
69 #undef QQQCOMPRESSED_EXH
70 #undef QQQMAINFL
71 #define QQQSINGLEFILE
72 #define QQQFILEID
73 #define QQQseparate
74 extern int QQQindicator;
75 static int QQQfirstmcdc=1;
76 #define commands_65zzopen zzopen
77  extern int commands_65zzopen ;
78 #define commands_65zqqzqz1 zqqzqz1
79 #define QQQLDRA_PORT
80 #ifndef QQQLDRA_PORT
81 #define FILEPOINT FILE * f,
82 #if !defined(QQQTEMPLATEONLY) && !defined(FILE) && !defined(QQQNOSTDIO)
83 #include <stdio.h>
84  /* ----------------------------------------------------------------------* 100 *
85  * If stdio.h is not available then insert:
86  * typedef int * FILE;
87  * -----------------------------------------------------------------------------
88  */
89 #endif /* !(QQQTEMPLATEONLY) && !(FILE) && !(QQQNOSTDIO) */
90 #else /* QQQLDRA_PORT */
91 #define FILEPOINT
92 /*************************** LDRA_PORT *********************************/
93 #ifdef QQQ_SHLAYOUT
94 static int tbrun_mode=1;
95 #else
96 static int tbrun_mode=0;
97 #endif /* QQQ_SHLAYOUT */
98 #include "C:\LDRA_Toolsuite\Compiler_spec\Microchip\Mplabx_xc32_script\ldra_port.h"
99 #include "C:\LDRA_Toolsuite\Compiler_spec\Microchip\Mplabx_xc32_script\ldra_port_common.h"
100 #ifndef QQQ_SHLAYOUT
101 #ifdef QQQMAINFL
102 #include "C:\LDRA_Toolsuite\Compiler_spec\Microchip\Mplabx_xc32_script\ldra_port.c"
103 #include "C:\LDRA_Toolsuite\Compiler_spec\Microchip\Mplabx_xc32_script\ldra_port_common.c"
104 #endif /* QQQMAINFL */
105 #endif /* QQQ_SHLAYOUT */
106 /************************ END OF LDRA_PORT *****************************/
107 #endif /* QQQLDRA_PORT */
108 #ifndef QQQnumfil
109 #define QQQnumfil 40 /* default setting */
110 #endif /* QQQnumfil */
111 #if defined(QQQstructbitmap) && defined(QQQSINGLEFILE)
112 #ifndef LDRA_VOID_FUNC
113 #define LDRA_VOID_FUNC
114  typedef void(*ldra_void_function)();
115 #endif
116 #if defined(QQQMAINFL)
117  /* Set qqqshell_upload to 1 if you want to call the qqqtotalupload separately. Although
118  through the target you would have to set this to 0 before calling the qqqupload.
119  Move this into ldra_port mechanism. */
120  int qqqshell_upload = 0;
121  int QQQfcn_ptr_num = 0;
122  static int qqqisinitialised = 0;
125  void qqqtotalupload(void);
126  void qqqtotalreset(void);
128  qqqaccumupload[x]=y;
129  qqqaccumreset[x]=z;
130  QQQfcn_ptr_num++;
131  }
132 #else /* (QQQMAINFL) */
133  extern int QQQfcn_ptr_num;
136  static int qqqstructzzopen = 0;
137 #endif /* defined(QQQMAINFL) */
138 #endif /* defined(QQQstructbitmap) && defined(QQQSINGLEFILE) */
139 #ifdef QQQ_KEEPCOMMENTS
140  /* -----------------------------------------------------------------------* 101 *
141  * Special settings for systems lacking standard functions.
142  * To include code for fprintf define ldra_fprintf
143  * To include code for sscanf define ldra_sscanf
144  * -----------------------------------------------------------------------------
145  */
146 #endif /* QQQ_KEEPCOMMENTS */
147 #if !defined(QQQSUPPRESS_UNDEF)
148 #undef ldra_fprintf
149 #undef ldra_sscanf
150 #endif /* !defined(QQQSUPPRESS_UNDEF) */
151  /* #define ldra_fprintf */
152  /* #define ldra_sscanf */
153 #undef QQQHITMAP_STORAGE
154 #undef qqnull_params
155 #define qqnull_params void
156 #define QQQ_PROTOTYPE_DEF
157  /* Conventional Instrumentation */
158 #undef QQ_ANSI_PROTOTYPE
159 #ifdef __STDC__
160 #define QQ_ANSI_PROTOTYPE 1
161 #else /* __STDC__ */
162 #ifdef VAXC
163 #define QQ_ANSI_PROTOTYPE 1
164 #endif /* VAXC */
165 #endif /* __STDC__ */
166  static unsigned char qqqzzglobflag = 0;
167  static struct bitmapstruct_t
168  {
169 #define ELEMENT(N) qqqbitmapint element##N;
170 #define LASTELEMENT
171 #include "commands_65zbelem.def"
172 #undef ELEMENT
173 #undef LASTELEMENT
174  } bitmapstruct = {
175 #define ELEMENT(N) 0,
176 #undef LASTELEMENT
177 #include "commands_65zbelem.def"
178 #undef ELEMENT
179  0};
180  static void qqoutput(FILEPOINT char * s,int i);
181  static void qqoutput2(FILEPOINT char * s,int i, int j);
182  static void qqoutput3(FILEPOINT char * s,int i,int j,int k);
183  static void qqoutput4(FILEPOINT char * s,int i,int j,int k,int l);
184  static void qqoutput0(FILEPOINT char * s);
185  static int commands_65zqqzqz(qqnull_params);
186  static int commands_65zqqzqz1(qqnull_params);
187  static int commands_65zqendz (int qqqi);
188  static int commands_65zqzqzq (int qqqi);
189  static void qqqupload(qqnull_params);
190  static void qqqbitmapreset(qqnull_params);
191 /* ------------------------------ END OF TESTBED PROTOTYPES -------------------------------- */
192 /* OPEN FILE C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\commands.h */
193 /**************************************************************************************/
207 /**************************************************************************************/
208 #ifndef COMMANDS_H /* Guard against multiple inclusion.*/
209 #define COMMANDS_H
210 /**************************************************************************************/
211 /**************************************************************************************/
212 /* Section: Included Files */
213 /**************************************************************************************/
214 /**************************************************************************************/
215 #include <stdbool.h>
216 #include <stdint.h>
217 /**************************************************************************************/
218 /**************************************************************************************/
219 /* Section: Global Variables */
220 /**************************************************************************************/
221 /**************************************************************************************/
222 
223 extern bool
224  DepthStatus ;
225 /**************************************************************************************/
226 /**************************************************************************************/
227 /* Section: Type Definition */
228 /**************************************************************************************/
229 /**************************************************************************************/
230 
231 typedef
232 unsigned char
234 /**************************************************************************************/
235 /**************************************************************************************/
236 /* Section: Data Types */
237 /**************************************************************************************/
238 /**************************************************************************************/
239 /**************************************************************************************/
240 
241 typedef
242  enum
243  {
248  } COMMAND_STATES ;
249 
250 typedef
251  struct /* This structure collects the variables and states required for these*/
252  {
253  /* functions to operate.*/
254  COMMAND_STATES state ;/* The COMMAND_TASKS machine current state.*/
255  uint16_t crc ;
256  uint8_t cmd_size ;
257  uint8_t command [ 7 ] ;
258  bool process_complete_flag ;
259  bool b_command_complete_flag ;
260  bool sw_status_bit_check ;
261  } COMMAND_DATA ;
262 
263 extern COMMAND_DATA
264  CMD ;
265 /**************************************************************************************/
266 /**************************************************************************************/
267 /* Section: Interface Functions */
268 /**************************************************************************************/
269 /**************************************************************************************/
270 /*!*************************************************************************************
271  Function:
272  void COMMAND_Tasks( void )
273  Summary:
274  This function executes the commands from the host.
275  Description:
276  This function executes the commands from the host. It does this by first ensuring
277  the CRC of the received command is correct. If the CRC check matches, it goes on
278  to execute the command. The commands are divided up into three types; Protocol A,
279  Protocol B and System. Protocol A commands control the function of the Panel
280  Interface Board. Protocol B commands are for a PerfSwitch or other down hole tool.
281  System commands control the panel operation while it is being used for shooting.
282  An example would be showing the depth status.
283 
284  Precondition:
285  None.
286  Parameters:
287  None.
288  Returns
289  None.
290 
291  Remarks:
292  None.
293 
294  Example:
295  void COMMAND_Tasks()
296  */
297 
298 void
299  COMMAND_Tasks ( void ) ;
300 /**************************************************************************************/
301 /**************************************************************************************/
302 /* Section: Local Functions */
303 /**************************************************************************************/
304 /**************************************************************************************/
305 /*!*************************************************************************************
306  Function:
307  bool Valid_Command( uchar8_t msg )
308  Summary:
309  This function compares the received command(first byte)and compares it to a list
310  of correct commands.
311  Description:
312  This function compares the received command(first byte)and compares it to a list
313  of correct commands. If there is a match, the rest of the transmission is
314  received for processing. Used in the ValidateComm function in commmodule.c
315 
316  Precondition:
317  None.
318  Parameters:
319  uchar8_t msg - The one byte command to compare.
320  Returns
321  bool ans - true if command is valid.
322 
323  Remarks
324  None.
325 
326  Example:
327  Valid_Command( command )
328  */
329 
330 bool
331  Valid_Command (
332  uchar8_t msg ) ;
333 /*!*************************************************************************************
334  Function:
335  bool GetDepthStatus ( void )
336  Summary:
337  This function compares the received command(first byte)and compares it to a list
338  of correct commands.
339  Description:
340  This function compares the received command(first byte)and compares it to a list
341  of correct commands. If there is a match, the rest of the transmission is
342  received for processing. Used in the ValidateComm function in commmodule.c
343 
344  Precondition:
345  None.
346  Parameters:
347  unsigned char msg - The one byte command to compare.
348  Returns
349  unsigned short ans.
350 
351  Remarks
352  None.
353 
354  Example:
355  GetDepthStatus ( )
356  */
357 
358 bool
359  GetDepthStatus ( void ) ;
360 /*!*************************************************************************************
361  Function:
362  static void Execute_Auto_Protocol_A (void)
363  Summary:
364  This function executes the Auto Protocol A commands.
365  Description:
366  This function executes the Auto Protocol A commands. These are commands that
367  control the panel. The commands are listed as case statements. Once the action is
368  completed, a response is generated and sent back to the host.
369 
370  Precondition:
371  None.
372  Parameters:
373  None.
374  Returns
375  None.
376 
377  Remarks
378  None.
379 
380  Example:
381  Execute_Auto_Protocol_A ()
382  */
383 
384 static void
385  Execute_Auto_Protocol_A ( void ) ;
386 /*!*************************************************************************************
387  Function:
388  static void Execute_Protocol_A (void)
389  Summary:
390  This function executes the Protocol A commands.
391  Description:
392  This function executes the Protocol A commands. These are commands that control
393  the panel. The commands are listed as case statements. Once the action is
394  completed, a response is generated and sent back to the host.
395 
396  Precondition:
397  None.
398  Parameters:
399  None.
400  Returns
401  None.
402 
403  Remarks
404  None.
405 
406  Example:
407  ExecuteProtocolA ()
408  */
409 
410 static void
411  Execute_Protocol_A ( void ) ;
412 /*!*************************************************************************************
413  Function:
414  static void Execute_Protocol_B (void)
415  Summary:
416  This function executes the Protocol B commands.
417  Description:
418  This function executes the Protocol B commands. These are commands that are for
419  a PerfSwitch or other tool. The commands are listed as case statements. Once
420  the action is completed, a response is generated and sent back to the host.
421 
422  Precondition:
423  None.
424  Parameters:
425  None.
426  Returns
427  None.
428 
429  Remarks
430  None.
431 
432  Example:
433  ExecuteProtocolB ()
434  */
435 
436 static void
437  Execute_Protocol_B ( void ) ;
438 /*!*************************************************************************************
439  Function:
440  static void Execute_System(void)
441  Summary:
442  This function executes the system commands.
443  Description:
444  This function executes the system commands. Once the action is completed, a
445  response is generated and sent back to the host.
446 
447  Precondition:
448  None.
449  Parameters:
450  None.
451  Returns
452  None.
453 
454  Remarks
455  None.
456 
457  Example:
458  ExecuteSystem()
459  */
460 
461 static void
462  Execute_System ( void ) ;
463  /* COMMANDS_H */
464 /***************************************************************************************
465  End of File
466  */
467 
468 #endif /*00 C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\commands.h*/
469 /* CLOSE_FILE Include File */
470 
471 /* OPEN FILE C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\crc.h */
472 /**************************************************************************************/
486 /**************************************************************************************/
487 #ifndef CRC_H /* Guard against multiple inclusion.*/
488 #define CRC_H
489 /**************************************************************************************/
490 /* ************************************************************************************/
491 /* Section: Included Files */
492 /**************************************************************************************/
493 /**************************************************************************************/
494 #include <stdint.h>
495 
496 typedef
497 unsigned char
498  uchar8_t ;
499 /**************************************************************************************/
500 /**************************************************************************************/
501 /* Interface Functions */
502 /**************************************************************************************/
503 /**************************************************************************************/
504 /*!*************************************************************************************
505  Function:
506  void Calc_CRC(uint16_t nbits, uint8_t thebits)
507  Summary:
508  Function to calculate the CRC for a number of data bits.
509  Description:
510  Function to calculate the CRC for a number of data bits. The algorithm for the
511  CRC calculation was created by Tom Woods. CRCVal is usually reset to 0xFF prior
512  to calling this function. This is not the case when calculating the CRC for an
513  array.
514 
515  Precondition:
516  None.
517  Parameters:
518  int16_t nbits - the number of data bits.
519  uint8_t thebits - the data bits themselves.
520  Returns
521  None.
522 
523  Remarks
524  None.
525 
526  Example:
527  Calc_CRC( 8, Bytes[ 1 ] )
528  */
529 
530 void
531  Calc_CRC (
532  uint16_t nbits ,
533  uint8_t thebits ) ;
534 /*!*************************************************************************************
535  Function:
536  uint8_t Calc_CRC_Array(uint16_t Count, const uint8_t Bytes[ ] )
537  Summary:
538  Function to calculate the CRC of an array of bytes. This function uses the function
539  CalcCRC to complete this task.
540  Description:
541  Function to calculate the CRC of an array of bytes. This function uses the function
542  CalcCRC to complete this task. It returns the eight bit CRCVal from the
543  calculation.
544 
545  Precondition:
546  None.
547  Parameters:
548  None.
549  Returns
550  uint8_t CRCVal
551 
552  Remarks
553  None.
554 
555  Example:
556  a_comm_crc = CalcCRCArray( 6, a_temp )
557  */
558 
559 uint8_t
561  uint16_t Count ,
562  const uint8_t Bytes [] ) ;
563 /*!*************************************************************************************
564  Function:
565  uint8_t Calc_CRC_Uplink(int16_t Count, const uint8_t Bytes[ ] )
566  Summary:
567  Function to calculate the CRC from a received PerfSwitch message.
568  Description:
569  Function to calculate the CRC from a received PerfSwitch message. This function
570  makes use of the function CalcCRC() to perform the calculation. The CRC result
571  is compared to the third byte of the returned Manchester message.
572 
573 
574 
575  Precondition:
576  None.
577  Parameters:
578  int16_t Count: Acts as a flag.
579  unsigned char Bytes[ ]:
580  Returns:
581  uint8_t CRCVal
582 
583  Remarks:
584  None.
585 
586  Example:
587  crcans1 = Calc_CRC_Uplink( 3, MAN.MSG )
588  */
589 
590 uint8_t
592  uint16_t Count ,
593  const uint8_t Bytes [] ) ;
594 /*!*************************************************************************************
595  Function:
596  void Reset_CRC_Value( void )
597  Summary:
598  This function resets the CRC value so a new calculation can take place.
599  Description:
600  This function resets the CRC value so a new calculation can take place. It
601  resets the value to 0xFF. This allows for the proper bit manipulation during
602  the CRC calculation.
603 
604  Precondition:
605  None.
606  Parameters:
607  None.
608  Returns
609  None.
610 
611  Remarks
612  None.
613 
614  Example:
615  Reset_CRC_Value()
616  */
617 
618 void
619  Reset_CRC_Value ( void ) ;
620 /*!*************************************************************************************
621  Function:
622  uint8_t GetCRCValue( void ))
623  Summary:
624  Function to return a previously calculated CRC value.
625  Description:
626  Function to return a previously calculated CRC value. No calculations are done
627  here.
628 
629  Precondition:
630  None.
631  Parameters:
632  None.
633  Returns
634  uint8_t CRCVal
635 
636  Remarks
637  None.
638 
639  Example:
640  FSK.crc = Get_CRC_Value( )
641  */
642 
643 uint8_t
644  Get_CRC_Value ( void ) ;
645  /* CRC_H */
646 /***************************************************************************************
647  End of File
648  */
649 
650 #endif /*00 C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\crc.h*/
651 /* CLOSE_FILE Include File */
652 
653 /* OPEN FILE C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\wl_cps.h */
654 /**************************************************************************************/
669 /**************************************************************************************/
670 #ifndef WL_CPS_H /* Guard against multiple inclusion */
671 #define WL_CPS_H
672 /**************************************************************************************/
673 /* ************************************************************************************/
674 /* Section: Included Files */
675 /**************************************************************************************/
676 /**************************************************************************************/
677 /* OPEN FILE C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\system_definitions.h */
678 /*******************************************************************************
679  System Definitions
680  File Name:
681  system_definitions.h
682  Summary:
683  MPLAB Harmony project system definitions.
684  Description:
685  This file contains the system-wide prototypes and definitions for an MPLAB
686  Harmony project.
687  *******************************************************************************/
688 //DOM-IGNORE-BEGIN
689 /*******************************************************************************
690 Copyright (c) 2013-2014 released Microchip Technology Inc. All rights reserved.
691 Microchip licenses to you the right to use, modify, copy and distribute
692 Software only when embedded on a Microchip microcontroller or digital signal
693 controller that is integrated into your product or third party product
694 (pursuant to the sublicense terms in the accompanying license agreement).
695 You should refer to the license agreement accompanying this Software for
696 additional information regarding your rights and obligations.
697 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
698 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
699 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
700 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
701 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
702 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
703 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
704 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
705 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
706 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
707  *******************************************************************************/
708 //DOM-IGNORE-END
709 #ifndef _SYS_DEFINITIONS_H
710 #define _SYS_DEFINITIONS_H
711 // *****************************************************************************
712 // *****************************************************************************
713 // Section: Included Files
714 // *****************************************************************************
715 // *****************************************************************************
716 #include <stdint.h>
717 #include <stddef.h>
718 #include <stdbool.h>
719 #include "system/common/sys_common.h"
720 #include "system/common/sys_module.h"
721 /* OPEN FILE C:\microchip\harmony\v2_06\framework\driver\ic\drv_ic.h */
722 /*******************************************************************************
723  Input Capture Driver Interface Declarations for Static Single Instance Driver
724  Company:
725  Microchip Technology Inc.
726  File Name:
727  help_drv_ic.h
728  Summary:
729  Input Capture driver interface declarations for the static single instance
730  driver.
731  Description:
732  The Input Capture device driver provides a simple interface to manage the
733  Input Capture modules on Microchip microcontrollers. This file defines
734  the interface declarations for the IC driver.
735 
736  Remarks:
737  Static interfaces incorporate the driver instance number within the names
738  of the routines, eliminating the need for an object ID or object handle.
739 
740  Static single-open interfaces also eliminate the need for the open handle.
741 *******************************************************************************/
742 //DOM-IGNORE-BEGIN
743 /*******************************************************************************
744 Copyright (c) 2016 released Microchip Technology Inc. All rights reserved.
745 Microchip licenses to you the right to use, modify, copy and distribute
746 Software only when embedded on a Microchip microcontroller or digital signal
747 controller that is integrated into your product or third party product
748 (pursuant to the sublicense terms in the accompanying license agreement).
749 You should refer to the license agreement accompanying this Software for
750 additional information regarding your rights and obligations.
751 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
752 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
753 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
754 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
755 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
756 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
757 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
758 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
759 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
760 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
761 *******************************************************************************/
762 //DOM-IGNORE-END
763 #ifndef _DRV_IC_H
764 #define _DRV_IC_H
765 /* OPEN FILE C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\system_config.h */
766 /*******************************************************************************
767  MPLAB Harmony System Configuration Header
768  File Name:
769  system_config.h
770  Summary:
771  Build-time configuration header for the system defined by this MPLAB Harmony
772  project.
773  Description:
774  An MPLAB Project may have multiple configurations. This file defines the
775  build-time options for a single configuration.
776  Remarks:
777  This configuration header must not define any prototypes or data
778  definitions (or include any files that do). It only provides macro
779  definitions for build-time configuration options that are not instantiated
780  until used by another MPLAB Harmony module or application.
781  Created with MPLAB Harmony Version 2.06
782 *******************************************************************************/
783 // DOM-IGNORE-BEGIN
784 /*******************************************************************************
785 Copyright (c) 2013-2015 released Microchip Technology Inc. All rights reserved.
786 Microchip licenses to you the right to use, modify, copy and distribute
787 Software only when embedded on a Microchip microcontroller or digital signal
788 controller that is integrated into your product or third party product
789 (pursuant to the sublicense terms in the accompanying license agreement).
790 You should refer to the license agreement accompanying this Software for
791 additional information regarding your rights and obligations.
792 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
793 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
794 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
795 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
796 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
797 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
798 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
799 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
800 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
801 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
802 *******************************************************************************/
803 // DOM-IGNORE-END
804 #ifndef _SYSTEM_CONFIG_H
805 #define _SYSTEM_CONFIG_H
806 // *****************************************************************************
807 // *****************************************************************************
808 // Section: Included Files
809 // *****************************************************************************
810 // *****************************************************************************
811 /* This section Includes other configuration headers necessary to completely
812  define this configuration.
813 */
814 // DOM-IGNORE-BEGIN
815 // DOM-IGNORE-END
816 // *****************************************************************************
817 // *****************************************************************************
818 // Section: System Service Configuration
819 // *****************************************************************************
820 // *****************************************************************************
821 // *****************************************************************************
822 /* Common System Service Configuration Options
823 */
824 #define SYS_VERSION_STR "2.06"
825 #define SYS_VERSION 20600
826 // *****************************************************************************
827 /* Clock System Service Configuration Options
828 */
829 #define SYS_CLK_FREQ 200000000ul
830 #define SYS_CLK_BUS_PERIPHERAL_1 100000000ul
831 #define SYS_CLK_BUS_PERIPHERAL_2 100000000ul
832 #define SYS_CLK_BUS_PERIPHERAL_3 100000000ul
833 #define SYS_CLK_BUS_PERIPHERAL_4 100000000ul
834 #define SYS_CLK_BUS_PERIPHERAL_5 100000000ul
835 #define SYS_CLK_BUS_PERIPHERAL_7 200000000ul
836 #define SYS_CLK_BUS_PERIPHERAL_8 100000000ul
837 #define SYS_CLK_CONFIG_PRIMARY_XTAL 0ul
838 #define SYS_CLK_CONFIG_SECONDARY_XTAL 32768ul
839 /*** Ports System Service Configuration ***/
840 #define SYS_PORT_A_ANSEL 0x3F00
841 #define SYS_PORT_A_TRIS 0xFFED
842 #define SYS_PORT_A_LAT 0x0010
843 #define SYS_PORT_A_ODC 0x0000
844 #define SYS_PORT_A_CNPU 0x0020
845 #define SYS_PORT_A_CNPD 0x0000
846 #define SYS_PORT_A_CNEN 0x0021
847 #define SYS_PORT_B_ANSEL 0x10C8
848 #define SYS_PORT_B_TRIS 0x91FF
849 #define SYS_PORT_B_LAT 0x0000
850 #define SYS_PORT_B_ODC 0x0000
851 #define SYS_PORT_B_CNPU 0x0000
852 #define SYS_PORT_B_CNPD 0x0000
853 #define SYS_PORT_B_CNEN 0x0000
854 #define SYS_PORT_C_ANSEL 0xCFE1
855 #define SYS_PORT_C_TRIS 0xFFFF
856 #define SYS_PORT_C_LAT 0x0000
857 #define SYS_PORT_C_ODC 0x0000
858 #define SYS_PORT_C_CNPU 0x0000
859 #define SYS_PORT_C_CNPD 0x0000
860 #define SYS_PORT_C_CNEN 0x0000
861 #define SYS_PORT_D_ANSEL 0xC100
862 #define SYS_PORT_D_TRIS 0xFFFF
863 #define SYS_PORT_D_LAT 0x0000
864 #define SYS_PORT_D_ODC 0x0000
865 #define SYS_PORT_D_CNPU 0x0000
866 #define SYS_PORT_D_CNPD 0x0000
867 #define SYS_PORT_D_CNEN 0x0000
868 #define SYS_PORT_E_ANSEL 0xFC00
869 #define SYS_PORT_E_TRIS 0xFDFF
870 #define SYS_PORT_E_LAT 0x0000
871 #define SYS_PORT_E_ODC 0x0000
872 #define SYS_PORT_E_CNPU 0x0000
873 #define SYS_PORT_E_CNPD 0x0000
874 #define SYS_PORT_E_CNEN 0x0000
875 #define SYS_PORT_F_ANSEL 0xCEC0
876 #define SYS_PORT_F_TRIS 0xEFFF
877 #define SYS_PORT_F_LAT 0x0000
878 #define SYS_PORT_F_ODC 0x0000
879 #define SYS_PORT_F_CNPU 0x0000
880 #define SYS_PORT_F_CNPD 0x0000
881 #define SYS_PORT_F_CNEN 0x0000
882 #define SYS_PORT_G_ANSEL 0x8CBC
883 #define SYS_PORT_G_TRIS 0xDFFF
884 #define SYS_PORT_G_LAT 0x0000
885 #define SYS_PORT_G_ODC 0x0000
886 #define SYS_PORT_G_CNPU 0x0000
887 #define SYS_PORT_G_CNPD 0x0000
888 #define SYS_PORT_G_CNEN 0x0000
889 #define SYS_PORT_H_ANSEL 0x0070
890 #define SYS_PORT_H_TRIS 0xB3FB
891 #define SYS_PORT_H_LAT 0x0000
892 #define SYS_PORT_H_ODC 0x0000
893 #define SYS_PORT_H_CNPU 0x0000
894 #define SYS_PORT_H_CNPD 0x0000
895 #define SYS_PORT_H_CNEN 0x0000
896 #define SYS_PORT_J_ANSEL 0x0000
897 #define SYS_PORT_J_TRIS 0x8B7F
898 #define SYS_PORT_J_LAT 0x0080
899 #define SYS_PORT_J_ODC 0x0000
900 #define SYS_PORT_J_CNPU 0x0000
901 #define SYS_PORT_J_CNPD 0x0000
902 #define SYS_PORT_J_CNEN 0x0800
903 #define SYS_PORT_K_ANSEL 0xFF00
904 #define SYS_PORT_K_TRIS 0xFFFF
905 #define SYS_PORT_K_LAT 0x0000
906 #define SYS_PORT_K_ODC 0x0000
907 #define SYS_PORT_K_CNPU 0x0000
908 #define SYS_PORT_K_CNPD 0x0000
909 #define SYS_PORT_K_CNEN 0x0000
910 /*** Interrupt System Service Configuration ***/
911 #define SYS_INT true
912 /*** Timer System Service Configuration ***/
913 #define SYS_TMR_POWER_STATE SYS_MODULE_POWER_RUN_FULL
914 #define SYS_TMR_DRIVER_INDEX DRV_TMR_INDEX_0
915 #define SYS_TMR_MAX_CLIENT_OBJECTS 5
916 #define SYS_TMR_FREQUENCY 1000
917 #define SYS_TMR_FREQUENCY_TOLERANCE 10
918 #define SYS_TMR_UNIT_RESOLUTION 10000
919 #define SYS_TMR_CLIENT_TOLERANCE 10
920 #define SYS_TMR_INTERRUPT_NOTIFICATION false
921 // *****************************************************************************
922 // *****************************************************************************
923 // Section: Driver Configuration
924 // *****************************************************************************
925 // *****************************************************************************
926 #define DRV_IC_DRIVER_MODE_STATIC
927 #define USE_8BIT_PMP
928 /*** SPI Driver Configuration ***/
929 #define DRV_SPI_NUMBER_OF_MODULES 6
930 /*** Driver Compilation and static configuration options. ***/
931 /*** Select SPI compilation units.***/
932 #define DRV_SPI_POLLED 1
933 #define DRV_SPI_ISR 0
934 #define DRV_SPI_MASTER 1
935 #define DRV_SPI_SLAVE 0
936 #define DRV_SPI_RM 0
937 #define DRV_SPI_EBM 1
938 #define DRV_SPI_8BIT 1
939 #define DRV_SPI_16BIT 1
940 #define DRV_SPI_32BIT 0
941 #define DRV_SPI_DMA 0
942 /*** SPI Driver Static Allocation Options ***/
943 #define DRV_SPI_INSTANCES_NUMBER 3
944 #define DRV_SPI_CLIENTS_NUMBER 3
945 #define DRV_SPI_ELEMENTS_PER_QUEUE 10
946 /* SPI Driver Instance 0 Configuration */
947 #define DRV_SPI_SPI_ID_IDX0 SPI_ID_1
948 #define DRV_SPI_TASK_MODE_IDX0 DRV_SPI_TASK_MODE_POLLED
949 #define DRV_SPI_SPI_MODE_IDX0 DRV_SPI_MODE_MASTER
950 #define DRV_SPI_ALLOW_IDLE_RUN_IDX0 false
951 #define DRV_SPI_SPI_PROTOCOL_TYPE_IDX0 DRV_SPI_PROTOCOL_TYPE_FRAMED
952 #define DRV_SPI_FRAME_SYNC_PULSE_IDX0 SPI_FRAME_SYNC_PULSE_ON_EVERY_DATA_CHARACTER
953 #define DRV_SPI_FRAME_PULSE_POLARITY_IDX0 SPI_FRAME_PULSE_POLARITY_ACTIVE_LOW
954 #define DRV_SPI_FRAME_PULSE_DIRECTION_IDX0 SPI_FRAME_PULSE_DIRECTION_OUTPUT
955 #define DRV_SPI_FRAME_PULSE_EDGE_IDX0 SPI_FRAME_PULSE_EDGE_COINCIDES_FIRST_BIT_CLOCK
956 #define DRV_SPI_FRAME_PULSE_WIDTH_IDX0 SPI_FRAME_PULSE_WIDTH_ONE_WORD_LENGTH
957 #define DRV_SPI_COMM_WIDTH_IDX0 SPI_COMMUNICATION_WIDTH_16BITS
958 #define DRV_SPI_CLOCK_SOURCE_IDX0 SPI_BAUD_RATE_PBCLK_CLOCK
959 #define DRV_SPI_SPI_CLOCK_IDX0 CLK_BUS_PERIPHERAL_2
960 #define DRV_SPI_BAUD_RATE_IDX0 1000000
961 #define DRV_SPI_BUFFER_TYPE_IDX0 DRV_SPI_BUFFER_TYPE_ENHANCED
962 #define DRV_SPI_CLOCK_MODE_IDX0 DRV_SPI_CLOCK_MODE_IDLE_LOW_EDGE_FALL
963 #define DRV_SPI_INPUT_PHASE_IDX0 SPI_INPUT_SAMPLING_PHASE_IN_MIDDLE
964 #define DRV_SPI_TRANSMIT_DUMMY_BYTE_VALUE_IDX0 0xFFFF
965 #define DRV_SPI_QUEUE_SIZE_IDX0 10
966 #define DRV_SPI_RESERVED_JOB_IDX0 1
967 /* SPI Driver Instance 1 Configuration */
968 #define DRV_SPI_SPI_ID_IDX1 SPI_ID_2
969 #define DRV_SPI_TASK_MODE_IDX1 DRV_SPI_TASK_MODE_POLLED
970 #define DRV_SPI_SPI_MODE_IDX1 DRV_SPI_MODE_MASTER
971 #define DRV_SPI_ALLOW_IDLE_RUN_IDX1 false
972 #define DRV_SPI_SPI_PROTOCOL_TYPE_IDX1 DRV_SPI_PROTOCOL_TYPE_FRAMED
973 #define DRV_SPI_FRAME_SYNC_PULSE_IDX1 SPI_FRAME_SYNC_PULSE_ON_EVERY_DATA_CHARACTER
974 #define DRV_SPI_FRAME_PULSE_POLARITY_IDX1 SPI_FRAME_PULSE_POLARITY_ACTIVE_LOW
975 #define DRV_SPI_FRAME_PULSE_DIRECTION_IDX1 SPI_FRAME_PULSE_DIRECTION_OUTPUT
976 #define DRV_SPI_FRAME_PULSE_EDGE_IDX1 SPI_FRAME_PULSE_EDGE_COINCIDES_FIRST_BIT_CLOCK
977 #define DRV_SPI_FRAME_PULSE_WIDTH_IDX1 SPI_FRAME_PULSE_WIDTH_ONE_WORD_LENGTH
978 #define DRV_SPI_COMM_WIDTH_IDX1 SPI_COMMUNICATION_WIDTH_8BITS
979 #define DRV_SPI_CLOCK_SOURCE_IDX1 SPI_BAUD_RATE_PBCLK_CLOCK
980 #define DRV_SPI_SPI_CLOCK_IDX1 CLK_BUS_PERIPHERAL_2
981 #define DRV_SPI_BAUD_RATE_IDX1 1000000
982 #define DRV_SPI_BUFFER_TYPE_IDX1 DRV_SPI_BUFFER_TYPE_ENHANCED
983 #define DRV_SPI_CLOCK_MODE_IDX1 DRV_SPI_CLOCK_MODE_IDLE_LOW_EDGE_FALL
984 #define DRV_SPI_INPUT_PHASE_IDX1 SPI_INPUT_SAMPLING_PHASE_IN_MIDDLE
985 #define DRV_SPI_TRANSMIT_DUMMY_BYTE_VALUE_IDX1 0xFF
986 #define DRV_SPI_QUEUE_SIZE_IDX1 10
987 #define DRV_SPI_RESERVED_JOB_IDX1 1
988 /* SPI Driver Instance 2 Configuration */
989 #define DRV_SPI_SPI_ID_IDX2 SPI_ID_4
990 #define DRV_SPI_TASK_MODE_IDX2 DRV_SPI_TASK_MODE_POLLED
991 #define DRV_SPI_SPI_MODE_IDX2 DRV_SPI_MODE_MASTER
992 #define DRV_SPI_ALLOW_IDLE_RUN_IDX2 false
993 #define DRV_SPI_SPI_PROTOCOL_TYPE_IDX2 DRV_SPI_PROTOCOL_TYPE_FRAMED
994 #define DRV_SPI_FRAME_SYNC_PULSE_IDX2 SPI_FRAME_SYNC_PULSE_ON_EVERY_DATA_CHARACTER
995 #define DRV_SPI_FRAME_PULSE_POLARITY_IDX2 SPI_FRAME_PULSE_POLARITY_ACTIVE_LOW
996 #define DRV_SPI_FRAME_PULSE_DIRECTION_IDX2 SPI_FRAME_PULSE_DIRECTION_OUTPUT
997 #define DRV_SPI_FRAME_PULSE_EDGE_IDX2 SPI_FRAME_PULSE_EDGE_COINCIDES_FIRST_BIT_CLOCK
998 #define DRV_SPI_FRAME_PULSE_WIDTH_IDX2 SPI_FRAME_PULSE_WIDTH_ONE_WORD_LENGTH
999 #define DRV_SPI_COMM_WIDTH_IDX2 SPI_COMMUNICATION_WIDTH_16BITS
1000 #define DRV_SPI_CLOCK_SOURCE_IDX2 SPI_BAUD_RATE_PBCLK_CLOCK
1001 #define DRV_SPI_SPI_CLOCK_IDX2 CLK_BUS_PERIPHERAL_2
1002 #define DRV_SPI_BAUD_RATE_IDX2 500000
1003 #define DRV_SPI_BUFFER_TYPE_IDX2 DRV_SPI_BUFFER_TYPE_ENHANCED
1004 #define DRV_SPI_CLOCK_MODE_IDX2 DRV_SPI_CLOCK_MODE_IDLE_LOW_EDGE_FALL
1005 #define DRV_SPI_INPUT_PHASE_IDX2 SPI_INPUT_SAMPLING_PHASE_AT_END
1006 #define DRV_SPI_TRANSMIT_DUMMY_BYTE_VALUE_IDX2 0x0000
1007 #define DRV_SPI_QUEUE_SIZE_IDX2 10
1008 #define DRV_SPI_RESERVED_JOB_IDX2 1
1009 /*** Timer Driver Configuration ***/
1010 #define DRV_TMR_INTERRUPT_MODE true
1011 /*** Timer Driver 0 Configuration ***/
1012 #define DRV_TMR_PERIPHERAL_ID_IDX0 TMR_ID_2
1013 #define DRV_TMR_INTERRUPT_SOURCE_IDX0 INT_SOURCE_TIMER_2
1014 #define DRV_TMR_INTERRUPT_VECTOR_IDX0 INT_VECTOR_T2
1015 #define DRV_TMR_ISR_VECTOR_IDX0 _TIMER_2_VECTOR
1016 #define DRV_TMR_INTERRUPT_PRIORITY_IDX0 INT_PRIORITY_LEVEL4
1017 #define DRV_TMR_INTERRUPT_SUB_PRIORITY_IDX0 INT_SUBPRIORITY_LEVEL0
1018 #define DRV_TMR_CLOCK_SOURCE_IDX0 DRV_TMR_CLKSOURCE_INTERNAL
1019 #define DRV_TMR_PRESCALE_IDX0 TMR_PRESCALE_VALUE_8
1020 #define DRV_TMR_OPERATION_MODE_IDX0 DRV_TMR_OPERATION_MODE_16_BIT
1021 #define DRV_TMR_ASYNC_WRITE_ENABLE_IDX0 false
1022 #define DRV_TMR_POWER_STATE_IDX0
1023 #define DRV_TMR_PERIPHERAL_ID_IDX1 TMR_ID_7
1024 #define DRV_TMR_INTERRUPT_SOURCE_IDX1 INT_SOURCE_TIMER_7
1025 #define DRV_TMR_INTERRUPT_VECTOR_IDX1 INT_VECTOR_T7
1026 #define DRV_TMR_ISR_VECTOR_IDX1 _TIMER_7_VECTOR
1027 #define DRV_TMR_INTERRUPT_PRIORITY_IDX1 INT_PRIORITY_LEVEL3
1028 #define DRV_TMR_INTERRUPT_SUB_PRIORITY_IDX1 INT_SUBPRIORITY_LEVEL0
1029 #define DRV_TMR_CLOCK_SOURCE_IDX1 DRV_TMR_CLKSOURCE_INTERNAL
1030 #define DRV_TMR_PRESCALE_IDX1 TMR_PRESCALE_VALUE_16
1031 #define DRV_TMR_OPERATION_MODE_IDX1 DRV_TMR_OPERATION_MODE_16_BIT
1032 #define DRV_TMR_ASYNC_WRITE_ENABLE_IDX1 false
1033 #define DRV_TMR_POWER_STATE_IDX1
1034 /*** Timer Driver 2 Configuration ***/
1035 #define DRV_TMR_PERIPHERAL_ID_IDX2 TMR_ID_6
1036 #define DRV_TMR_INTERRUPT_SOURCE_IDX2 INT_SOURCE_TIMER_6
1037 #define DRV_TMR_INTERRUPT_VECTOR_IDX2 INT_VECTOR_T6
1038 #define DRV_TMR_ISR_VECTOR_IDX2 _TIMER_6_VECTOR
1039 #define DRV_TMR_INTERRUPT_PRIORITY_IDX2 INT_PRIORITY_LEVEL1
1040 #define DRV_TMR_INTERRUPT_SUB_PRIORITY_IDX2 INT_SUBPRIORITY_LEVEL0
1041 #define DRV_TMR_CLOCK_SOURCE_IDX2 DRV_TMR_CLKSOURCE_INTERNAL
1042 #define DRV_TMR_PRESCALE_IDX2 TMR_PRESCALE_VALUE_16
1043 #define DRV_TMR_OPERATION_MODE_IDX2 DRV_TMR_OPERATION_MODE_16_BIT
1044 #define DRV_TMR_ASYNC_WRITE_ENABLE_IDX2 false
1045 #define DRV_TMR_POWER_STATE_IDX2
1046 /*** Timer Driver 3 Configuration ***/
1047 #define DRV_TMR_PERIPHERAL_ID_IDX3 TMR_ID_1
1048 #define DRV_TMR_INTERRUPT_SOURCE_IDX3 INT_SOURCE_TIMER_1
1049 #define DRV_TMR_INTERRUPT_VECTOR_IDX3 INT_VECTOR_T1
1050 #define DRV_TMR_ISR_VECTOR_IDX3 _TIMER_1_VECTOR
1051 #define DRV_TMR_INTERRUPT_PRIORITY_IDX3 INT_PRIORITY_LEVEL2
1052 #define DRV_TMR_INTERRUPT_SUB_PRIORITY_IDX3 INT_SUBPRIORITY_LEVEL0
1053 #define DRV_TMR_CLOCK_SOURCE_IDX3 DRV_TMR_CLKSOURCE_INTERNAL
1054 #define DRV_TMR_PRESCALE_IDX3 TMR_PRESCALE_VALUE_256
1055 #define DRV_TMR_OPERATION_MODE_IDX3 DRV_TMR_OPERATION_MODE_16_BIT
1056 #define DRV_TMR_ASYNC_WRITE_ENABLE_IDX3 false
1057 #define DRV_TMR_POWER_STATE_IDX3
1058 /*** Timer Driver 4 Configuration ***/
1059 #define DRV_TMR_PERIPHERAL_ID_IDX4 TMR_ID_3
1060 #define DRV_TMR_INTERRUPT_SOURCE_IDX4 INT_SOURCE_TIMER_3
1061 #define DRV_TMR_INTERRUPT_VECTOR_IDX4 INT_VECTOR_T3
1062 #define DRV_TMR_ISR_VECTOR_IDX4 _TIMER_3_VECTOR
1063 #define DRV_TMR_INTERRUPT_PRIORITY_IDX4 INT_PRIORITY_LEVEL1
1064 #define DRV_TMR_INTERRUPT_SUB_PRIORITY_IDX4 INT_SUBPRIORITY_LEVEL0
1065 #define DRV_TMR_CLOCK_SOURCE_IDX4 DRV_TMR_CLKSOURCE_INTERNAL
1066 #define DRV_TMR_PRESCALE_IDX4 TMR_PRESCALE_VALUE_16
1067 #define DRV_TMR_OPERATION_MODE_IDX4 DRV_TMR_OPERATION_MODE_16_BIT
1068 #define DRV_TMR_ASYNC_WRITE_ENABLE_IDX4 false
1069 #define DRV_TMR_POWER_STATE_IDX4
1070  // *****************************************************************************
1071 /* USART Driver Configuration Options
1072 */
1073 #define DRV_USART_INSTANCES_NUMBER 1
1074 #define DRV_USART_CLIENTS_NUMBER 1
1075 #define DRV_USART_INTERRUPT_MODE false
1076 #define DRV_USART_BYTE_MODEL_SUPPORT true
1077 #define DRV_USART_READ_WRITE_MODEL_SUPPORT false
1078 #define DRV_USART_BUFFER_QUEUE_SUPPORT false
1079 // *****************************************************************************
1080 // *****************************************************************************
1081 // Section: Middleware & Other Library Configuration
1082 // *****************************************************************************
1083 // *****************************************************************************
1084 /*** USB Driver Configuration ***/
1085 /* Enables Device Support */
1086 #define DRV_USBHS_DEVICE_SUPPORT true
1087 /* Disable Host Support */
1088 #define DRV_USBHS_HOST_SUPPORT false
1089 /* Maximum USB driver instances */
1090 #define DRV_USBHS_INSTANCES_NUMBER 1
1091 /* Interrupt mode enabled */
1092 #define DRV_USBHS_INTERRUPT_MODE true
1093 /* Number of Endpoints used */
1094 #define DRV_USBHS_ENDPOINTS_NUMBER 2
1095 /*** USB Device Stack Configuration ***/
1096 /* The USB Device Layer will not initialize the USB Driver */
1097 #define USB_DEVICE_DRIVER_INITIALIZE_EXPLICIT
1098 /* Maximum device layer instances */
1099 #define USB_DEVICE_INSTANCES_NUMBER 1
1100 /* EP0 size in bytes */
1101 #define USB_DEVICE_EP0_BUFFER_SIZE 64
1102 /* Endpoint Transfer Queue Size combined for Read and write */
1103 #define USB_DEVICE_ENDPOINT_QUEUE_DEPTH_COMBINED 2
1104 // *****************************************************************************
1105 // *****************************************************************************
1106 // Section: Application Configuration
1107 // *****************************************************************************
1108 // *****************************************************************************
1109 /*** Application Defined Pins ***/
1110 /*** Functions for LED1 pin ***/
1111 #define LED1Toggle( ) PLIB_PORTS_PinToggle ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_12 )
1112 #define LED1On( ) PLIB_PORTS_PinSet ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_12 )
1113 #define LED1Off( ) PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_12 )
1114 #define LED1StateGet( ) PLIB_PORTS_PinGetLatched ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_12 )
1115 #define LED1StateSet( Value ) PLIB_PORTS_PinWrite ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_12 , Value )
1116 /*** Functions for LED2 pin ***/
1117 #define LED2Toggle( ) PLIB_PORTS_PinToggle ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_10 )
1118 #define LED2On( ) PLIB_PORTS_PinSet ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_10 )
1119 #define LED2Off( ) PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_10 )
1120 #define LED2StateGet( ) PLIB_PORTS_PinGetLatched ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_10 )
1121 #define LED2StateSet( Value ) PLIB_PORTS_PinWrite ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_10 , Value )
1122 /*** Functions for DMP_FIRE_LED pin ***/
1123 #define DMP_FIRE_LEDToggle( ) PLIB_PORTS_PinToggle ( PORTS_ID_0 , PORT_CHANNEL_E , PORTS_BIT_POS_9 )
1124 #define DMP_FIRE_LEDOn( ) PLIB_PORTS_PinSet ( PORTS_ID_0 , PORT_CHANNEL_E , PORTS_BIT_POS_9 )
1125 #define DMP_FIRE_LEDOff( ) PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_E , PORTS_BIT_POS_9 )
1126 #define DMP_FIRE_LEDStateGet( ) PLIB_PORTS_PinGetLatched ( PORTS_ID_0 , PORT_CHANNEL_E , PORTS_BIT_POS_9 )
1127 #define DMP_FIRE_LEDStateSet( Value ) PLIB_PORTS_PinWrite ( PORTS_ID_0 , PORT_CHANNEL_E , PORTS_BIT_POS_9 , Value )
1128 /*** Functions for HVPS_ENB pin ***/
1129 #define HVPS_ENBToggle( ) PLIB_PORTS_PinToggle ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_13 )
1130 #define HVPS_ENBOn( ) PLIB_PORTS_PinSet ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_13 )
1131 #define HVPS_ENBOff( ) PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_13 )
1132 #define HVPS_ENBStateGet( ) PLIB_PORTS_PinGetLatched ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_13 )
1133 #define HVPS_ENBStateSet( Value ) PLIB_PORTS_PinWrite ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_13 , Value )
1134 /*** Functions for RLY_HVPS_OUT pin ***/
1135 #define RLY_HVPS_OUTToggle( ) PLIB_PORTS_PinToggle ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_14 )
1136 #define RLY_HVPS_OUTOn( ) PLIB_PORTS_PinSet ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_14 )
1137 #define RLY_HVPS_OUTOff( ) PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_14 )
1138 #define RLY_HVPS_OUTStateGet( ) PLIB_PORTS_PinGetLatched ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_14 )
1139 #define RLY_HVPS_OUTStateSet( Value ) PLIB_PORTS_PinWrite ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_14 , Value )
1140 /*** Functions for RLY_WL_SPS_POL pin ***/
1141 #define RLY_WL_SPS_POLToggle( ) PLIB_PORTS_PinToggle ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_2 )
1142 #define RLY_WL_SPS_POLOn( ) PLIB_PORTS_PinSet ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_2 )
1143 #define RLY_WL_SPS_POLOff( ) PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_2 )
1144 #define RLY_WL_SPS_POLStateGet( ) PLIB_PORTS_PinGetLatched ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_2 )
1145 #define RLY_WL_SPS_POLStateSet( Value ) PLIB_PORTS_PinWrite ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_2 , Value )
1146 /*** Functions for RLY_LOG pin ***/
1147 #define RLY_LOGToggle( ) PLIB_PORTS_PinToggle ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_9 )
1148 #define RLY_LOGOn( ) PLIB_PORTS_PinSet ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_9 )
1149 #define RLY_LOGOff( ) PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_9 )
1150 #define RLY_LOGStateGet( ) PLIB_PORTS_PinGetLatched ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_9 )
1151 #define RLY_LOGStateSet( Value ) PLIB_PORTS_PinWrite ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_9 , Value )
1152 /*** Functions for RLY_DMP_FIRE pin ***/
1153 #define RLY_DMP_FIREToggle( ) PLIB_PORTS_PinToggle ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_10 )
1154 #define RLY_DMP_FIREOn( ) PLIB_PORTS_PinSet ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_10 )
1155 #define RLY_DMP_FIREOff( ) PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_10 )
1156 #define RLY_DMP_FIREStateGet( ) PLIB_PORTS_PinGetLatched ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_10 )
1157 #define RLY_DMP_FIREStateSet( Value ) PLIB_PORTS_PinWrite ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_10 , Value )
1158 /*** Functions for RLY_AUX pin ***/
1159 #define RLY_AUXToggle( ) PLIB_PORTS_PinToggle ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_11 )
1160 #define RLY_AUXOn( ) PLIB_PORTS_PinSet ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_11 )
1161 #define RLY_AUXOff( ) PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_11 )
1162 #define RLY_AUXStateGet( ) PLIB_PORTS_PinGetLatched ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_11 )
1163 #define RLY_AUXStateSet( Value ) PLIB_PORTS_PinWrite ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_11 , Value )
1164 /*** Functions for RLY_CCL pin ***/
1165 #define RLY_CCLToggle( ) PLIB_PORTS_PinToggle ( PORTS_ID_0 , PORT_CHANNEL_A , PORTS_BIT_POS_1 )
1166 #define RLY_CCLOn( ) PLIB_PORTS_PinSet ( PORTS_ID_0 , PORT_CHANNEL_A , PORTS_BIT_POS_1 )
1167 #define RLY_CCLOff( ) PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_A , PORTS_BIT_POS_1 )
1168 #define RLY_CCLStateGet( ) PLIB_PORTS_PinGetLatched ( PORTS_ID_0 , PORT_CHANNEL_A , PORTS_BIT_POS_1 )
1169 #define RLY_CCLStateSet( Value ) PLIB_PORTS_PinWrite ( PORTS_ID_0 , PORT_CHANNEL_A , PORTS_BIT_POS_1 , Value )
1170 /*** Functions for RLY_WL_MON pin ***/
1171 #define RLY_WL_MONToggle( ) PLIB_PORTS_PinToggle ( PORTS_ID_0 , PORT_CHANNEL_F , PORTS_BIT_POS_12 )
1172 #define RLY_WL_MONOn( ) PLIB_PORTS_PinSet ( PORTS_ID_0 , PORT_CHANNEL_F , PORTS_BIT_POS_12 )
1173 #define RLY_WL_MONOff( ) PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_F , PORTS_BIT_POS_12 )
1174 #define RLY_WL_MONStateGet( ) PLIB_PORTS_PinGetLatched ( PORTS_ID_0 , PORT_CHANNEL_F , PORTS_BIT_POS_12 )
1175 #define RLY_WL_MONStateSet( Value ) PLIB_PORTS_PinWrite ( PORTS_ID_0 , PORT_CHANNEL_F , PORTS_BIT_POS_12 , Value )
1176 /*** Functions for RLY_ARMCF pin ***/
1177 #define RLY_ARMCFToggle( ) PLIB_PORTS_PinToggle ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_13 )
1178 #define RLY_ARMCFOn( ) PLIB_PORTS_PinSet ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_13 )
1179 #define RLY_ARMCFOff( ) PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_13 )
1180 #define RLY_ARMCFStateGet( ) PLIB_PORTS_PinGetLatched ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_13 )
1181 #define RLY_ARMCFStateSet( Value ) PLIB_PORTS_PinWrite ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_13 , Value )
1182 /*** Functions for RLY_ARM pin ***/
1183 #define RLY_ARMToggle( ) PLIB_PORTS_PinToggle ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_14 )
1184 #define RLY_ARMOn( ) PLIB_PORTS_PinSet ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_14 )
1185 #define RLY_ARMOff( ) PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_14 )
1186 #define RLY_ARMStateGet( ) PLIB_PORTS_PinGetLatched ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_14 )
1187 #define RLY_ARMStateSet( Value ) PLIB_PORTS_PinWrite ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_14 , Value )
1188 /*** Functions for TPAN1 pin ***/
1189 #define TPAN1Toggle( ) PLIB_PORTS_PinToggle ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_10 )
1190 #define TPAN1On( ) PLIB_PORTS_PinSet ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_10 )
1191 #define TPAN1Off( ) PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_10 )
1192 #define TPAN1StateGet( ) PLIB_PORTS_PinGetLatched ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_10 )
1193 #define TPAN1StateSet( Value ) PLIB_PORTS_PinWrite ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_10 , Value )
1194 /*** Functions for TPAN2 pin ***/
1195 #define TPAN2Toggle( ) PLIB_PORTS_PinToggle ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_11 )
1196 #define TPAN2On( ) PLIB_PORTS_PinSet ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_11 )
1197 #define TPAN2Off( ) PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_11 )
1198 #define TPAN2StateGet( ) PLIB_PORTS_PinGetLatched ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_11 )
1199 #define TPAN2StateSet( Value ) PLIB_PORTS_PinWrite ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_11 , Value )
1200 /*** Functions for FSK_DAC_CS pin ***/
1201 #define FSK_DAC_CSToggle( ) PLIB_PORTS_PinToggle ( PORTS_ID_0 , PORT_CHANNEL_A , PORTS_BIT_POS_4 )
1202 #define FSK_DAC_CSOn( ) PLIB_PORTS_PinSet ( PORTS_ID_0 , PORT_CHANNEL_A , PORTS_BIT_POS_4 )
1203 #define FSK_DAC_CSOff( ) PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_A , PORTS_BIT_POS_4 )
1204 #define FSK_DAC_CSStateGet( ) PLIB_PORTS_PinGetLatched ( PORTS_ID_0 , PORT_CHANNEL_A , PORTS_BIT_POS_4 )
1205 #define FSK_DAC_CSStateSet( Value ) PLIB_PORTS_PinWrite ( PORTS_ID_0 , PORT_CHANNEL_A , PORTS_BIT_POS_4 , Value )
1206 /*** Functions for RLY_COMM pin ***/
1207 #define RLY_COMMToggle( ) PLIB_PORTS_PinToggle ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_14 )
1208 #define RLY_COMMOn( ) PLIB_PORTS_PinSet ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_14 )
1209 #define RLY_COMMOff( ) PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_14 )
1210 #define RLY_COMMStateGet( ) PLIB_PORTS_PinGetLatched ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_14 )
1211 #define RLY_COMMStateSet( Value ) PLIB_PORTS_PinWrite ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_14 , Value )
1212 /*** Functions for FSK_DAC_CLR pin ***/
1213 #define FSK_DAC_CLRToggle( ) PLIB_PORTS_PinToggle ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_7 )
1214 #define FSK_DAC_CLROn( ) PLIB_PORTS_PinSet ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_7 )
1215 #define FSK_DAC_CLROff( ) PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_7 )
1216 #define FSK_DAC_CLRStateGet( ) PLIB_PORTS_PinGetLatched ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_7 )
1217 #define FSK_DAC_CLRStateSet( Value ) PLIB_PORTS_PinWrite ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_7 , Value )
1218 /*** Functions for WL_CPS_SW pin ***/
1219 #define WL_CPS_SWToggle( ) PLIB_PORTS_PinToggle ( PORTS_ID_0 , PORT_CHANNEL_G , PORTS_BIT_POS_13 )
1220 #define WL_CPS_SWOn( ) PLIB_PORTS_PinSet ( PORTS_ID_0 , PORT_CHANNEL_G , PORTS_BIT_POS_13 )
1221 #define WL_CPS_SWOff( ) PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_G , PORTS_BIT_POS_13 )
1222 #define WL_CPS_SWStateGet( ) PLIB_PORTS_PinGetLatched ( PORTS_ID_0 , PORT_CHANNEL_G , PORTS_BIT_POS_13 )
1223 #define WL_CPS_SWStateSet( Value ) PLIB_PORTS_PinWrite ( PORTS_ID_0 , PORT_CHANNEL_G , PORTS_BIT_POS_13 , Value )
1224 /*** Functions for HVPS_SW pin ***/
1225 #define HVPS_SWStateGet( ) PLIB_PORTS_PinGet ( PORTS_ID_0 , PORT_CHANNEL_A , PORTS_BIT_POS_5 )
1226 /*** Functions for MAN_SIG pin ***/
1227 #define MAN_SIGStateGet( ) PLIB_PORTS_PinGet ( PORTS_ID_0 , PORT_CHANNEL_A , PORTS_BIT_POS_0 )
1228 /*** Functions for DMP_FIRE_SW pin ***/
1229 #define DMP_FIRE_SWStateGet( ) PLIB_PORTS_PinGet ( PORTS_ID_0 , PORT_CHANNEL_E , PORTS_BIT_POS_8 )
1230 /*** Functions for NEG_SW pin ***/
1231 #define NEG_SWStateGet( ) PLIB_PORTS_PinGet ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_4 )
1232 /*** Functions for POS_SW pin ***/
1233 #define POS_SWStateGet( ) PLIB_PORTS_PinGet ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_15 )
1234 /*** Functions for DRUM1_SW pin ***/
1235 #define DRUM1_SWStateGet( ) PLIB_PORTS_PinGet ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_2 )
1236 /*** Functions for SAFE_SW pin ***/
1237 #define SAFE_SWStateGet( ) PLIB_PORTS_PinGet ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_1 )
1238 /*** Functions for DRUM2_SW pin ***/
1239 #define DRUM2_SWStateGet( ) PLIB_PORTS_PinGet ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_0 )
1240 /*** Functions for LOG_SW pin ***/
1241 #define LOG_SWStateGet( ) PLIB_PORTS_PinGet ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_3 )
1242 /*** Functions for AUX_SW pin ***/
1243 #define AUX_SWStateGet( ) PLIB_PORTS_PinGet ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_8 )
1244 /*** Functions for ARMCF_SW pin ***/
1245 #define ARMCF_SWStateGet( ) PLIB_PORTS_PinGet ( PORTS_ID_0 , PORT_CHANNEL_K , PORTS_BIT_POS_1 )
1246 /*** Functions for ARM_SW pin ***/
1247 #define ARM_SWStateGet( ) PLIB_PORTS_PinGet ( PORTS_ID_0 , PORT_CHANNEL_K , PORTS_BIT_POS_2 )
1248 /*** Functions for ARMCF_AUTO_SW pin ***/
1249 #define ARMCF_AUTO_SWStateGet( ) PLIB_PORTS_PinGet ( PORTS_ID_0 , PORT_CHANNEL_F , PORTS_BIT_POS_13 )
1250 /*** Functions for FIRE_SW_OFF pin ***/
1251 #define FIRE_SW_OFFStateGet( ) PLIB_PORTS_PinGet ( PORTS_ID_0 , PORT_CHANNEL_F , PORTS_BIT_POS_8 )
1252 /*** Functions for FIRE_SW_ON pin ***/
1253 #define FIRE_SW_ONStateGet( ) PLIB_PORTS_PinGet ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_8 )
1254 /*** Functions for WL_SPS_POS_DET pin ***/
1255 #define WL_SPS_POS_DETStateGet( ) PLIB_PORTS_PinGet ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_12 )
1256 /*** Functions for WL_SPS_NEG_DET pin ***/
1257 #define WL_SPS_NEG_DETStateGet( ) PLIB_PORTS_PinGet ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_13 )
1258 #define MAN_CN_PORT_CHANNEL PORT_CHANNEL_A
1259 #define MAN_CN_PORT_BIT PORTS_BIT_POS_0
1260 #define MAN_CN_PORT_INTERRUPT INT_SOURCE_CHANGE_NOTICE_A
1261 #define HVPS_CN_PORT_CHANNEL PORT_CHANNEL_J
1262 #define HVPS_CN_PORT_BIT PORTS_BIT_POS_11
1263 #define HVPS_CN_PORT_INTERRUPT INT_SOURCE_CHANGE_NOTICE_J
1264 /*** Application Instance 0 Configuration ***/
1265 //DOM-IGNORE-BEGIN
1266 //DOM-IGNORE-END
1267  // _SYSTEM_CONFIG_H
1268 /*******************************************************************************
1269  End of File
1270 */
1271 #endif /*00 C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\system_config.h*/
1272 /* CLOSE_FILE Include File */
1273 
1274 /* OPEN FILE C:\microchip\harmony\v2_06\framework\driver\driver_common.h */
1275 /*******************************************************************************
1276  Driver Common Header Definitions
1277  Company:
1278  Microchip Technology Inc.
1279  File Name:
1280  drv_common.h
1281  Summary:
1282  This file defines the common macros and definitions used by the driver
1283  definition and implementation headers.
1284  Description:
1285  This file defines the common macros and definitions used by the driver
1286  definition and the implementation header.
1287  Remarks:
1288  The directory in which this file resides should be added to the compiler's
1289  search path for header files.
1290  *******************************************************************************/
1291 //DOM-IGNORE-BEGIN
1292 /*******************************************************************************
1293 Copyright (c) 2010-2013 released Microchip Technology Inc. All rights reserved.
1294 Microchip licenses to you the right to use, modify, copy and distribute
1295 Software only when embedded on a Microchip microcontroller or digital signal
1296 controller that is integrated into your product or third party product
1297 (pursuant to the sublicense terms in the accompanying license agreement).
1298 You should refer to the license agreement accompanying this Software for
1299 additional information regarding your rights and obligations.
1300 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS-IS WITHOUT WARRANTY OF ANY KIND,
1301 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
1302 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
1303 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
1304 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
1305 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
1306 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
1307 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
1308 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
1309 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
1310  *******************************************************************************/
1311 //DOM-IGNORE-END
1312 #ifndef _DRV_COMMON_H
1313 #define _DRV_COMMON_H
1314 #include <stdint.h>
1315 #include <stddef.h>
1316 // *****************************************************************************
1317 /* Device Driver I/O Intent
1318  Summary:
1319  Identifies the intended usage of the device when it is opened.
1320  Description:
1321  This enumeration identifies the intended usage of the device when the
1322  caller opens the device. It identifies the desired behavior of the device
1323  driver for the following:
1324  * Blocking or non-blocking I/O behavior (do I/O calls such as read and write
1325  block until the operation is finished or do they return immediately and
1326  require the caller to call another routine to check the status of the
1327  operation)
1328  * Support reading and/or writing of data from/to the device
1329  * Identify the buffering behavior (sometimes called "double buffering" of
1330  the driver. Indicates if the driver should maintain its own read/write
1331  buffers and copy data to/from these buffers to/from the caller's buffers.
1332  * Identify the DMA behavior of the peripheral
1333  Remarks:
1334  The buffer allocation method is not identified by this enumeration. Buffers
1335  can be allocated statically at build time, dynamically at run-time, or
1336  even allocated by the caller and passed to the driver for its own usage if
1337  a driver-specific routine is provided for such. This choice is left to
1338  the design of the individual driver and is considered part of its
1339  interface.
1340  These values can be considered "flags". One selection from each of the
1341  groups below can be ORed together to create the complete value passed
1342  to the driver's open routine.
1343 */
1344 
1345 typedef
1346  enum
1347  {
1348  /* Read */
1349  DRV_IO_INTENT_READ /*DOM-IGNORE-BEGIN*/
1350  = 1 << 0 /* DOM-IGNORE-END*/
1351  ,
1352  /* Write */
1353  DRV_IO_INTENT_WRITE /*DOM-IGNORE-BEGIN*/
1354  = 1 << 1 /* DOM-IGNORE-END*/
1355  ,
1356  /* Read and Write*/
1357  DRV_IO_INTENT_READWRITE /*DOM-IGNORE-BEGIN*/
1358  = DRV_IO_INTENT_READ | DRV_IO_INTENT_WRITE /* DOM-IGNORE-END*/
1359  ,
1360  /* The driver will block and will return when the operation is complete */
1361  DRV_IO_INTENT_BLOCKING /*DOM-IGNORE-BEGIN*/
1362  = 0 << 2 /* DOM-IGNORE-END*/
1363  ,
1364  /* The driver will return immediately */
1365  DRV_IO_INTENT_NONBLOCKING /*DOM-IGNORE-BEGIN*/
1366  = 1 << 2 /* DOM-IGNORE-END*/
1367  ,
1368  /* The driver will support only one client at a time */
1369  DRV_IO_INTENT_EXCLUSIVE /*DOM-IGNORE-BEGIN*/
1370  = 1 << 3 /* DOM-IGNORE-END*/
1371  ,
1372  /* The driver will support multiple clients at a time */
1373  DRV_IO_INTENT_SHARED /*DOM-IGNORE-BEGIN*/
1374  = 0 << 3 /* DOM-IGNORE-END*/
1375  } DRV_IO_INTENT ;
1376 // *****************************************************************************
1377 /* Driver Client Status
1378  Summary:
1379  Identifies the current status/state of a client's connection to a driver.
1380  Description:
1381  This enumeration identifies the current status/state of a client's link to
1382  a driver.
1383  Remarks:
1384  The enumeration used as the return type for the client-level status routines
1385  defined by each device driver or system module (for example,
1386  DRV_USART_ClientStatus) must be based on the values in this enumeration.
1387 */
1388 
1389 typedef
1390  enum
1391  {
1392  /* Indicates that a driver-specific error has occurred. */
1394  /* An unspecified error has occurred.*/
1396  /* The driver is closed, no operations for this client are ongoing,
1397  and/or the given handle is invalid. */
1399  /* The driver is currently busy and cannot start additional operations. */
1401  /* The module is running and ready for additional operations */
1403  /* Indicates that the module is in a driver-specific ready/run state. */
1405  } DRV_CLIENT_STATUS ;
1406 // *****************************************************************************
1407 /* Device Driver Blocking Status Macro
1408  Summary:
1409  Returns if the I/O intent provided is blocking
1410  Description:
1411  This macro returns if the I/O intent provided is blocking.
1412  Remarks:
1413  None.
1414 */
1415 #define DRV_IO_ISBLOCKING( intent ) ( intent & DRV_IO_INTENT_BLOCKING )
1416 // *****************************************************************************
1417 /* Device Driver Non Blocking Status Macro
1418  Summary:
1419  Returns if the I/O intent provided is non-blocking.
1420  Description:
1421  This macro returns if the I/ intent provided is non-blocking.
1422  Remarks:
1423  None.
1424 */
1425 #define DRV_IO_ISNONBLOCKING( intent ) ( intent & DRV_IO_INTENT_NONBLOCKING )
1426 // *****************************************************************************
1427 /* Device Driver Exclusive Status Macro
1428  Summary:
1429  Returns if the I/O intent provided is non-blocking.
1430  Description:
1431  This macro returns if the I/O intent provided is non-blocking.
1432  Remarks:
1433  None.
1434 */
1435 #define DRV_IO_ISEXCLUSIVE( intent ) ( intent & DRV_IO_INTENT_EXCLUSIVE )
1436 // *****************************************************************************
1437 /* Device Driver IO Buffer Identifier
1438  Summary:
1439  Identifies to which buffer a device operation will apply.
1440  Description:
1441  This enumeration identifies to which buffer (read, write, both, or neither)
1442  a device operation will apply. This is used for "flush" (or similar)
1443  operations.
1444 */
1445 
1446 typedef
1447  enum
1448  {
1449  // Operation does not apply to any buffer
1451  // Operation applies to read buffer
1453  // Operation applies to write buffer
1455  // Operation applies to both read and write buffers
1458 // *****************************************************************************
1459 /* Device Handle
1460  Summary:
1461  Handle to an opened device driver.
1462  Description:
1463  This handle identifies the open instance of a device driver. It must be
1464  passed to all other driver routines (except the initialization, deinitialization,
1465  or power routines) to identify the caller.
1466  Remarks:
1467  Every application or module that wants to use a driver must first call
1468  the driver's open routine. This is the only routine that is absolutely
1469  required for every driver.
1470  If a driver is unable to allow an additional module to use it, it must then
1471  return the special value DRV_HANDLE_INVALID. Callers should check the
1472  handle returned for this value to ensure this value was not returned before
1473  attempting to call any other driver routines using the handle.
1474 */
1475 
1476 typedef
1477 uintptr_t
1479 // *****************************************************************************
1480 /* Invalid Device Handle
1481  Summary:
1482  Invalid device handle.
1483  Description:
1484  If a driver is unable to allow an additional module to use it, it must then
1485  return the special value DRV_HANDLE_INVALID. Callers should check the
1486  handle returned for this value to ensure this value was not returned before
1487  attempting to call any other driver routines using the handle.
1488  Remarks:
1489  None.
1490 */
1491 #define DRV_HANDLE_INVALID ( ( ( DRV_HANDLE ) - 1 ) )
1492 // *****************************************************************************
1493 /* Not supported configuration
1494  Summary:
1495  Not supported configuration.
1496  Description:
1497  If the configuration option is not supported on an instance of the
1498  peripheral, use this macro to equate to that configuration. This option
1499  should be listed as a possible value in the description of that
1500  configuration option.
1501 */
1502 #define DRV_CONFIG_NOT_SUPPORTED ( ( ( unsigned short ) - 1 ) )
1503 // *****************************************************************************
1504 /* Unsupported Attribute Abstraction
1505  Summary:
1506  Abstracts the use of the unsupported attribute defined by the compiler.
1507  Description:
1508  This macro nulls the definition of the _PLIB_UNSUPPORTED macro, to support
1509  compilation of the drivers for all different variants.
1510  Example:
1511  void _PLIB_UNSUPPORTED PLIB_USART_Enable(USART_MODULE_ID index);
1512  This function will not generate a compiler error if the interface is not
1513  defined for the selected device.
1514  Remarks:
1515  None.
1516 */
1517 #define _PLIB_UNSUPPORTED
1518  //_DRV_COMMON_H
1519 /*******************************************************************************
1520  End of File
1521 */
1522 #endif /*00 C:\microchip\harmony\v2_06\framework\driver\driver_common.h*/
1523 /* CLOSE_FILE Include File */
1524 
1525 #include "system/common/sys_module.h"
1526 // *****************************************************************************
1527 /* IC Driver Module Index Numbers
1528  Summary:
1529  IC driver index definitions.
1530  Description:
1531  These constants provide IC Driver index definitions.
1532  Remarks:
1533  These constants should be used in place of hard-coded numeric literals.
1534  These values should be passed into the DRV_IC_Initialize and
1535  DRV_IC_Open routines to identify the driver instance in use.
1536 */
1537 #define DRV_IC_INDEX_0 0
1538 #define DRV_IC_INDEX_1 1
1539 #define DRV_IC_INDEX_2 2
1540 #define DRV_IC_INDEX_3 3
1541 #define DRV_IC_INDEX_4 4
1542 #define DRV_IC_INDEX_5 5
1543 #define DRV_IC_INDEX_6 6
1544 #define DRV_IC_INDEX_7 7
1545 #define DRV_IC_INDEX_8 8
1546 #define DRV_IC_INDEX_9 9
1547 #define DRV_IC_INDEX_10 10
1548 #define DRV_IC_INDEX_11 11
1549 #define DRV_IC_INDEX_12 12
1550 #define DRV_IC_INDEX_13 13
1551 #define DRV_IC_INDEX_14 14
1552 #define DRV_IC_INDEX_15 15
1553 // *****************************************************************************
1554 // *****************************************************************************
1555 // Section: Interface Headers for the static driver
1556 // *****************************************************************************
1557 // *****************************************************************************
1558 // *****************************************************************************
1559 /* Function:
1560  SYS_MODULE_OBJ DRV_IC_Initialize(const SYS_MODULE_INDEX index,
1561  const SYS_MODULE_INIT * const init);
1562  Summary:
1563  Initializes the Input Capture instance for the specified driver index.
1564  <p><b>Implementation:</b> Static</p>
1565  Description:
1566  This routine initializes the Input Capture driver instance for the specified
1567  driver instance, making it ready for clients to use it. The initialization
1568  routine is specified by the MHC parameters. The driver instance index is
1569  independent of the Input Capture module ID. For example, driver instance 0
1570  can be assigned to Input Capture 2.
1571  Precondition:
1572  None.
1573  Parameters:
1574  None.
1575  Returns:
1576  None.
1577  Remarks:
1578  This routine must be called before any other Input Capture routine is called.
1579  This routine should only be called once during system initialization.
1580 */
1581 
1582 SYS_MODULE_OBJ
1584  const SYS_MODULE_INDEX index ,
1585  const SYS_MODULE_INIT * const init ) ;
1586 // *****************************************************************************
1587 /* Function:
1588 DRV_HANDLE DRV_IC_Open(const SYS_MODULE_INDEX drvIndex, const DRV_IO_INTENT intent)
1589  Summary:
1590  Opens the Input Capture instance for the specified driver index.
1591  <p><b>Implementation:</b> Static</p>
1592  Description:
1593  This routine starts the Input Capture driver for the specified driver
1594  index, starting an input capture.
1595  Precondition:
1596  DRV_IC_Initialize has been called.
1597  Parameters:
1598  None.
1599  Returns:
1600  None.
1601  Remarks:
1602  None.
1603 */
1604 
1605 DRV_HANDLE
1606  DRV_IC_Open (
1607  const SYS_MODULE_INDEX drvIndex ,
1608  const DRV_IO_INTENT intent ) ;
1609 // *****************************************************************************
1610 /* Function:
1611  void DRV_IC_Close(DRV_HANDLE handle)
1612  Summary:
1613  Closes the Input Capture instance for the specified driver index.
1614  <p><b>Implementation:</b> Static</p>
1615  Description:
1616  This routine stops the Input Capture driver for the specified driver
1617  index, stopping an input capture.
1618  Precondition:
1619  DRV_IC_Initialize has been called.
1620  Parameters:
1621  None.
1622  Returns:
1623  None.
1624  Remarks:
1625  None.
1626 */
1627 
1628 void
1629  DRV_IC_Close (
1630  DRV_HANDLE handle ) ;
1631 // *****************************************************************************
1632 /* Function:
1633 DRV_HANDLE DRV_IC_Start(const SYS_MODULE_INDEX drvIndex, const DRV_IO_INTENT intent)
1634  Summary:
1635  Starts the Input Capture instance for the specified driver index.
1636  <p><b>Implementation:</b> Static</p>
1637  Description:
1638  This routine starts the Input Capture driver for the specified driver
1639  index, starting an input capture.
1640  Precondition:
1641  DRV_IC_Initialize has been called.
1642  Parameters:
1643  None.
1644  Returns:
1645  None.
1646  Remarks:
1647  None.
1648 */
1649 
1650 DRV_HANDLE
1651  DRV_IC_Start (
1652  const SYS_MODULE_INDEX drvIndex ,
1653  const DRV_IO_INTENT intent ) ;
1654 // *****************************************************************************
1655 /* Function:
1656  void DRV_IC_Stop(DRV_HANDLE handle)
1657  Summary:
1658  Stops the Input Capture instance for the specified driver index.
1659  <p><b>Implementation:</b> Static</p>
1660  Description:
1661  This routine stops the Input Capture driver for the specified driver
1662  index, stopping an input capture.
1663  Precondition:
1664  DRV_IC_Initialize has been called.
1665  Parameters:
1666  None.
1667  Returns:
1668  None.
1669  Remarks:
1670  None.
1671 */
1672 
1673 void
1674  DRV_IC_Stop (
1675  DRV_HANDLE handle ) ;
1676 // *****************************************************************************
1677 /* Function:
1678  uint32_t DRV_IC_Capture32BitDataRead(DRV_HANDLE handle)
1679  Summary:
1680  Reads the 32-bit Input Capture for the specified driver index.
1681  <p><b>Implementation:</b> Static</p>
1682  Description:
1683  This routine reads the 32-bit data for the specified driver index
1684  Precondition:
1685  DRV_IC_Initialize has been called.
1686  Parameters:
1687  None.
1688  Returns:
1689  uint32_t value of the data read from the Input Capture.
1690  Remarks:
1691  None.
1692 */
1693 
1694 uint32_t
1696  DRV_HANDLE handle ) ;
1697 // *****************************************************************************
1698 /* Function:
1699  uint16_t DRV_IC_Capture16BitDataRead(DRV_HANDLE handle)
1700  Summary:
1701  Reads the 16-bit Input Capture for the specified driver index.
1702  <p><b>Implementation:</b> Static</p>
1703  Description:
1704  This routine reads the 16-bit data for the specified driver index.
1705  Precondition:
1706  DRV_IC_Initialize has been called.
1707  Parameters:
1708  None.
1709  Returns:
1710  uint16_t value of the data read from the Input Capture.
1711  Remarks:
1712  None.
1713 */
1714 
1715 uint16_t
1717  DRV_HANDLE handle ) ;
1718 // *****************************************************************************
1719 /* Function:
1720  bool DRV_IC_BufferIsEmpty(DRV_HANDLE handle)
1721  Summary:
1722  Returns the Input Capture instance buffer empty status for the specified driver
1723  index.
1724  <p><b>Implementation:</b> Static</p>
1725  Description:
1726  Returns the Input Capture instance buffer empty status for the specified driver
1727  index. The function should be called to determine whether or not the IC buffer
1728  has data.
1729  Precondition:
1730  DRV_IC_Initialize has been called.
1731  Parameters:
1732  None.
1733  Returns:
1734  Boolean
1735  - 1 - Buffer is empty
1736  - 0 - Buffer is not empty
1737  Remarks:
1738  None.
1739 */
1740 
1741 bool
1743  DRV_HANDLE handle ) ;
1744 /* OPEN FILE C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\framework\driver\ic\drv_ic_static.h */
1745 /*******************************************************************************
1746  IC Driver Interface Declarations for Static Single Instance Driver
1747  Company:
1748  Microchip Technology Inc.
1749  File Name:
1750  drv_ic_static.h
1751  Summary:
1752  IC driver interface declarations for the static single instance driver.
1753  Description:
1754  The IC device driver provides a simple interface to manage the IC
1755  modules on Microchip microcontrollers. This file defines the interface
1756  Declarations for the IC driver.
1757 
1758  Remarks:
1759  Static interfaces incorporate the driver instance number within the names
1760  of the routines, eliminating the need for an object ID or object handle.
1761 
1762  Static single-open interfaces also eliminate the need for the open handle.
1763 *******************************************************************************/
1764 //DOM-IGNORE-BEGIN
1765 /*******************************************************************************
1766 Copyright (c) 2013 released Microchip Technology Inc. All rights reserved.
1767 Microchip licenses to you the right to use, modify, copy and distribute
1768 Software only when embedded on a Microchip microcontroller or digital signal
1769 controller that is integrated into your product or third party product
1770 (pursuant to the sublicense terms in the accompanying license agreement).
1771 You should refer to the license agreement accompanying this Software for
1772 additional information regarding your rights and obligations.
1773 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
1774 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
1775 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
1776 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
1777 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
1778 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
1779 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
1780 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
1781 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
1782 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
1783 *******************************************************************************/
1784 //DOM-IGNORE-END
1785 #ifndef _DRV_IC_STATIC_H
1786 #define _DRV_IC_STATIC_H
1787 #define DRV_IC_Open( drvIndex , intent ) ( drvIndex )
1788 #define DRV_IC_Close( handle )
1789 // *****************************************************************************
1790 // *****************************************************************************
1791 // Section: Interface Headers for Instance 0 for the static driver
1792 // *****************************************************************************
1793 // *****************************************************************************
1794 
1795 void
1796  DRV_IC0_Initialize ( void ) ;
1797 
1798 void
1799  DRV_IC0_Start ( void ) ;
1800 
1801 void
1802  DRV_IC0_Stop ( void ) ;
1803 
1804 uint32_t
1805  DRV_IC0_Capture32BitDataRead ( void ) ;
1806 
1807 uint16_t
1808  DRV_IC0_Capture16BitDataRead ( void ) ;
1809 
1810 bool
1811  DRV_IC0_BufferIsEmpty ( void ) ;
1812  // #ifndef _DRV_IC_STATIC_H
1813 /*******************************************************************************
1814  End of File
1815 */
1816 
1817 #endif /*00 C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\framework\driver\ic\drv_ic_static.h*/
1818 /* CLOSE_FILE Include File */
1819 
1820  // #ifndef _DRV_IC_H
1821 /*******************************************************************************
1822  End of File
1823 */
1824 #endif /*00 C:\microchip\harmony\v2_06\framework\driver\ic\drv_ic.h*/
1825 /* CLOSE_FILE Include File */
1826 
1827 #include "system/devcon/sys_devcon.h"
1828 #include "system/clk/sys_clk.h"
1829 #include "system/int/sys_int.h"
1830 #include "system/tmr/sys_tmr.h"
1831 /* OPEN FILE C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\framework\driver\adc\drv_adc_static.h */
1832 /*******************************************************************************
1833  ADC Driver Interface Declarations for Static Single Instance Driver
1834  Company:
1835  Microchip Technology Inc.
1836  File Name:
1837  drv_adc_static.h
1838  Summary:
1839  ADC driver interface declarations for the static single instance driver.
1840  Description:
1841  The ADC device driver provides a simple interface to manage the ADC
1842  modules on Microchip microcontrollers. This file defines the interface
1843  Declarations for the ADC driver.
1844 
1845  Remarks:
1846  Static interfaces incorporate the driver instance number within the names
1847  of the routines, eliminating the need for an object ID or object handle.
1848 
1849  Static single-open interfaces also eliminate the need for the open handle.
1850 *******************************************************************************/
1851 //DOM-IGNORE-BEGIN
1852 /*******************************************************************************
1853 Copyright (c) 2013 released Microchip Technology Inc. All rights reserved.
1854 Microchip licenses to you the right to use, modify, copy and distribute
1855 Software only when embedded on a Microchip microcontroller or digital signal
1856 controller that is integrated into your product or third party product
1857 (pursuant to the sublicense terms in the accompanying license agreement).
1858 You should refer to the license agreement accompanying this Software for
1859 additional information regarding your rights and obligations.
1860 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
1861 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
1862 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
1863 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
1864 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
1865 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
1866 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
1867 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
1868 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
1869 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
1870 *******************************************************************************/
1871 //DOM-IGNORE-END
1872 #ifndef _DRV_ADC_STATIC_H
1873 #define _DRV_ADC_STATIC_H
1874 #include <stdbool.h>
1875 #include "C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\system_config.h" /* LDRA full path */
1876 #include "peripheral/adchs/plib_adchs.h"
1877 #include "peripheral/int/plib_int.h"
1878 
1879 typedef
1880  enum
1881  {
1882  DRV_ADC_ID_1 = ADCHS_ID_0 ,
1884  } DRV_ADC_MODULE_ID ;
1885 // *****************************************************************************
1886 // *****************************************************************************
1887 // Section: Interface Headers for ADC Static Driver
1888 // *****************************************************************************
1889 // *****************************************************************************
1890 
1891 void
1892  DRV_ADC_Initialize ( void ) ;
1893 
1894 inline void
1895  DRV_ADC_DeInitialize ( void ) ;
1896 
1897 inline void
1898  DRV_ADC0_Open ( void ) ;
1899 
1900 inline void
1901  DRV_ADC0_Close ( void ) ;
1902 
1903 inline void
1904  DRV_ADC1_Open ( void ) ;
1905 
1906 inline void
1907  DRV_ADC1_Close ( void ) ;
1908 
1909 inline void
1910  DRV_ADC_Start ( void ) ;
1911 
1912 inline void
1913  DRV_ADC_Stop ( void ) ;
1914 
1915 uint32_t
1917  uint8_t bufIndex ) ;
1918 
1919 bool
1921  uint8_t bufIndex ) ;
1922  // #ifndef _DRV_ADC_STATIC_H
1923 /*******************************************************************************
1924  End of File
1925 */
1926 
1927 #endif /*00 C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\framework\driver\adc\drv_adc_static.h*/
1928 /* CLOSE_FILE Include File */
1929 
1930 /* OPEN FILE C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\framework\driver\tmr\drv_tmr_static.h */
1931 /*******************************************************************************
1932  Timer Driver Interface Declarations for Static Single Instance Driver
1933  Company:
1934  Microchip Technology Inc.
1935  File Name:
1936  drv_tmr_static.h
1937  Summary:
1938  Timer driver interface declarations for the static single instance driver.
1939  Description:
1940  The Timer device driver provides a simple interface to manage the Timer
1941  modules on Microchip microcontrollers. This file defines the interface
1942  Declarations for the TMR driver.
1943 
1944  Remarks:
1945  Static interfaces incorporate the driver instance number within the names
1946  of the routines, eliminating the need for an object ID or object handle.
1947 
1948  Static single-open interfaces also eliminate the need for the open handle.
1949 *******************************************************************************/
1950 //DOM-IGNORE-BEGIN
1951 /*******************************************************************************
1952 Copyright (c) 2014 released Microchip Technology Inc. All rights reserved.
1953 Microchip licenses to you the right to use, modify, copy and distribute
1954 Software only when embedded on a Microchip microcontroller or digital signal
1955 controller that is integrated into your product or third party product
1956 (pursuant to the sublicense terms in the accompanying license agreement).
1957 You should refer to the license agreement accompanying this Software for
1958 additional information regarding your rights and obligations.
1959 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
1960 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
1961 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTOCULAR PURPOSE.
1962 IN NO EVENT SHALL MOCROCHIP OR ITS LOCENSORS BE LIABLE OR OBLIGATED UNDER
1963 CONTRACT, NEGLIGENCE, STROCT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
1964 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
1965 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
1966 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
1967 SUBSTITUTE GOODS, TECHNOLOGY, SERVOCES, OR ANY CLAIMS BY THIRD PARTIES
1968 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
1969 *******************************************************************************/
1970 //DOM-IGNORE-END
1971 #ifndef _DRV_TMR_STATIC_H
1972 #define _DRV_TMR_STATIC_H
1973 // *****************************************************************************
1974 // *****************************************************************************
1975 // Section: Include Headers
1976 // *****************************************************************************
1977 // *****************************************************************************
1978 #include <stdint.h>
1979 /* OPEN FILE C:\microchip\harmony\v2_06\framework\driver\tmr\drv_tmr.h */
1980 /*******************************************************************************
1981  Timer Device Driver Interface Definition
1982  Company:
1983  Microchip Technology Inc.
1984  File Name:
1985  drv_tmr.h
1986  Summary:
1987  Timer device driver interface header file.
1988  Description:
1989  This header file contains the function prototypes and definitions of the
1990  data types and constants that make up the interface to the Timer device
1991  driver.
1992 *******************************************************************************/
1993 //DOM-IGNORE-BEGIN
1994 /*******************************************************************************
1995 Copyright (c) 2013-2014 released Microchip Technology Inc. All rights reserved.
1996 Microchip licenses to you the right to use, modify, copy and distribute
1997 Software only when embedded on a Microchip microcontroller or digital signal
1998 controller that is integrated into your product or third party product
1999 (pursuant to the sublicense terms in the accompanying license agreement).
2000 You should refer to the license agreement accompanying this Software for
2001 additional information regarding your rights and obligations.
2002 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
2003 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
2004 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
2005 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
2006 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
2007 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
2008 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
2009 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
2010 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
2011 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
2012 *******************************************************************************/
2013 //DOM-IGNORE-END
2014 #ifndef _DRV_TMR_H
2015 #define _DRV_TMR_H
2016 // *****************************************************************************
2017 // *****************************************************************************
2018 // Section: File includes
2019 // *****************************************************************************
2020 // *****************************************************************************
2021 #include "C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\system_config.h" /* LDRA full path */
2022 #include "C:\microchip\harmony\v2_06\framework\driver\driver_common.h" /* LDRA full path */
2023 #include "peripheral/tmr/plib_tmr.h"
2024 /* OPEN FILE C:\microchip\harmony\v2_06\framework\driver\tmr\tmr_definitions_pic32m.h */
2025 /*******************************************************************************
2026  Timer Device Driver Interface Definition
2027  Company:
2028  Microchip Technology Inc.
2029  File Name:
2030  tmr_definitions_pic32m.h
2031  Summary:
2032  Timer device driver definitions header file.
2033  Description:
2034  This header file contains the definitions of the
2035  data types and constants that make up the interface to the Timer device
2036  driver.
2037 *******************************************************************************/
2038 //DOM-IGNORE-BEGIN
2039 /*******************************************************************************
2040 Copyright (c) 2013-2014 released Microchip Technology Inc. All rights reserved.
2041 Microchip licenses to you the right to use, modify, copy and distribute
2042 Software only when embedded on a Microchip microcontroller or digital signal
2043 controller that is integrated into your product or third party product
2044 (pursuant to the sublicense terms in the accompanying license agreement).
2045 You should refer to the license agreement accompanying this Software for
2046 additional information regarding your rights and obligations.
2047 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
2048 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
2049 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
2050 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
2051 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
2052 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
2053 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
2054 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
2055 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
2056 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
2057 *******************************************************************************/
2058 //DOM-IGNORE-END
2059 #ifndef _TMR_DEFINITIONS_PIC32M_H
2060 #define _TMR_DEFINITIONS_PIC32M_H
2061 // DOM-IGNORE-BEGIN
2062 // DOM-IGNORE-END
2063 
2064 typedef
2065  enum
2066  {
2067  /* Clock input to the timer module is internal(Peripheral Clock) */
2069  /*DOM-IGNORE-BEGIN*/
2070  = 0x00 /*DOM-IGNORE-END*/
2071  ,
2072  /* Clock input to the timer module is from T1CK pin (external)
2073  with clock synchronization enabled */
2075  /*DOM-IGNORE-BEGIN*/
2076  = 0x01 /*DOM-IGNORE-END*/
2077  ,
2078  /* Clock input to the timer module is from T1CK pin (external)
2079  with clock synchronization disabled */
2081  /*DOM-IGNORE-BEGIN*/
2082  = 0x11 /*DOM-IGNORE-END*/
2083  ,
2084  /* Clock input to the timer module is from secondary oscillator (external)
2085  with clock synchronization enabled */
2087  /*DOM-IGNORE-BEGIN*/
2088  = 0x02 /*DOM-IGNORE-END*/
2089  ,
2090  /* Clock input to the timer module is from secondary oscillator (external)
2091  with clock synchronization disabled */
2093  /*DOM-IGNORE-BEGIN*/
2094  = 0x12 /*DOM-IGNORE-END*/
2095  ,
2096  /* Clock input to the timer module is from LPRC
2097  with clock synchronization enabled */
2099  /*DOM-IGNORE-BEGIN*/
2100  = 0x03 /*DOM-IGNORE-END*/
2101  ,
2102  /* Clock input to the timer module is from LPRC
2103  with clock synchronization disabled */
2105  /*DOM-IGNORE-BEGIN*/
2106  = 0x13 /*DOM-IGNORE-END*/
2108 //DOM-IGNORE-BEGIN
2109 //DOM-IGNORE-END
2110  // #ifndef _DRV_TMR_H
2111 /*******************************************************************************
2112  End of File
2113 */
2114 
2115 #endif /*00 C:\microchip\harmony\v2_06\framework\driver\tmr\tmr_definitions_pic32m.h*/
2116 /* CLOSE_FILE Include File */
2117 
2118 #include "system/int/sys_int.h" // System Interrupt Definitions
2119 #include "system/clk/sys_clk.h"
2120 // DOM-IGNORE-BEGIN
2121 // DOM-IGNORE-END
2122 // *****************************************************************************
2123 // *****************************************************************************
2124 // Section: TMR Driver Data Types
2125 // *****************************************************************************
2126 // *****************************************************************************
2127 // *****************************************************************************
2128 /* Timer Driver Module Index Numbers
2129  Summary:
2130  Timer driver index definitions
2131  Description:
2132  These constants provide Timer driver index definitions.
2133  Remarks:
2134  These constants should be used in place of hard-coded numeric literals.
2135  These values should be passed into the DRV_TMR_Initialize and DRV_TMR_Open
2136  functions to identify the driver instance in use.
2137 */
2138 #define DRV_TMR_INDEX_0 0
2139 #define DRV_TMR_INDEX_1 1
2140 #define DRV_TMR_INDEX_2 2
2141 #define DRV_TMR_INDEX_3 3
2142 #define DRV_TMR_INDEX_4 4
2143 #define DRV_TMR_INDEX_5 5
2144 #define DRV_TMR_INDEX_6 6
2145 #define DRV_TMR_INDEX_7 7
2146 #define DRV_TMR_INDEX_8 8
2147 #define DRV_TMR_INDEX_9 9
2148 #define DRV_TMR_INDEX_10 10
2149 #define DRV_TMR_INDEX_11 11
2150 // *****************************************************************************
2151 /* Timer Driver Module Index Count
2152  Summary:
2153  Number of valid Timer driver indices.
2154  Description:
2155  This constant identifies Timer driver index definitions.
2156  Remarks:
2157  This constant should be used in place of hard-coded numeric literals.
2158  This value is device-specific.
2159 */
2160 #define DRV_TMR_INDEX_COUNT TMR_NUMBER_OF_MODULES
2161 // *****************************************************************************
2162 /* Timer Driver Client Status
2163  Summary:
2164  Identifies the client-specific status of the Timer driver
2165  Description:
2166  This enumeration identifies the client-specific status of the Timer driver.
2167  Remarks:
2168  None.
2169 */
2170 
2171 typedef
2172  enum
2173  {
2174  /* Driver is invalid (or unopened) state */
2176  /*DOM-IGNORE-BEGIN*/
2177  = DRV_CLIENT_STATUS_ERROR /*DOM-IGNORE-END*/
2178  ,
2179  /* An operation is currently in progress */
2181  /*DOM-IGNORE-BEGIN*/
2182  = DRV_CLIENT_STATUS_BUSY /*DOM-IGNORE-END*/
2183  ,
2184  /* Ready, no operations running */
2186  /*DOM-IGNORE-BEGIN*/
2187  = DRV_CLIENT_STATUS_READY + 0 /*DOM-IGNORE-END*/
2188  ,
2189  /* Timer started and running, processing transactions */
2191  /*DOM-IGNORE-BEGIN*/
2192  = DRV_CLIENT_STATUS_READY + 1 /*DOM-IGNORE-END*/
2194 // *****************************************************************************
2195 /* Timer Driver Clock sources
2196  Summary:
2197  Lists the clock sources available for timer driver.
2198  Description:
2199  This enumeration lists all the available clock sources for the timer
2200  hardware.
2201  Remarks:
2202  Not all modes are available on all devices.
2203  'Synchronization' may not be applicable for all the instances of the timer.
2204  The driver discards the Synchronization mode selected if it is not
2205  applicable for the selected hardware.
2206 */
2207 // *****************************************************************************
2208 /* Timer Driver Operation mode
2209  Summary:
2210  Lists the operation modes available for timer driver.
2211  Description:
2212  This enumeration lists all the available operation modes that are valid for
2213  the timer hardware.
2214  Remarks:
2215  Not all modes are available on all devices.
2216 */
2217 
2218 typedef
2219  enum
2220  {
2221  /* The timer module operating mode none/invalid */
2223  /* The timer module operates in 16 bit mode */
2225  /* The timer module operates in 32 bit mode */
2226  /* This will combine two 16 bit timer modules */
2229 // *****************************************************************************
2230 /* Timer Driver divider operating specification
2231  Summary:
2232  This data structure specifies the divider values that can be obtained by the
2233  timer module.
2234  Description:
2235  This data structure specifies the divider values that can be obtained by the
2236  timer hardware.
2237  Remarks:
2238  None.
2239 */
2240 
2241 typedef
2242  struct
2243  {
2244  /* The minimum divider value that the timer module can obtain */
2245  uint32_t dividerMin ;
2246  /* The maximum divider value that the timer module can obtain */
2247  uint32_t dividerMax ;
2248  /* The divider step value, between 2 divider values */
2249  /* Should be 1 for most timers */
2250  uint32_t dividerStep ;
2252 // *****************************************************************************
2253 /* Timer Driver Initialize Data
2254  Summary:
2255  Defines the Timer driver initialization data.
2256  Description:
2257  This data type defines data required to initialize the Timer driver.
2258  Remarks:
2259  Not all initialization features are available on all devices.
2260 */
2261 
2262 typedef
2263  struct
2264  {
2265  /* System module initialization. */
2266  SYS_MODULE_INIT moduleInit ;
2267  /* Identifies timer hardware module (PLIB-level) ID */
2268  TMR_MODULE_ID tmrId ;
2269  /* Clock Source select. */
2270  DRV_TMR_CLK_SOURCES clockSource ;
2271  /* Prescaler Selection from the processor enumeration */
2272  TMR_PRESCALE prescale ;
2273  /* Interrupt Source for TMR module. If 'DRV_TMR_OPERATION_MODE_32_BIT' flag
2274  is selected the interrupt will be generated by the 2nd timer of the pair,
2275  the odd numbered one. */
2276  INT_SOURCE interruptSource ;
2277  /* Select 16/32 bit operation mode. 32 bit mode will combine two 16 bit
2278  timer modules to form a 32 bit one. This is usually only necessary for
2279  very long delays. */
2280  DRV_TMR_OPERATION_MODE mode ;
2281  /* Asynchronous write enable configuration. If true the asynchronous write
2282  is enabled. For timers that do not support this feature the value is
2283  ignored */
2284  bool asyncWriteEnable ;
2285  } DRV_TMR_INIT ;
2286 // *****************************************************************************
2287 /* Timer Driver Callback Function Pointer
2288  Summary:
2289  Pointer to a Timer driver callback function data type.
2290  Description:
2291  This data type defines a pointer to a Timer driver callback function.
2292  Remarks:
2293  Useful only when timer alarm callback support is enabled by defining the
2294  DRV_TMR_ALARM_ENABLE configuration option.
2295 */
2296 
2297 typedef
2298 void ( * DRV_TMR_CALLBACK ) ( uintptr_t context ,
2299 uint32_t alarmCount ) ;
2300 // *****************************************************************************
2301 // *****************************************************************************
2302 // Section: Timer Driver Module Interface Functions
2303 // *****************************************************************************
2304 // *****************************************************************************
2305 // *****************************************************************************
2306 /* Function:
2307  SYS_MODULE_OBJ DRV_TMR_Initialize
2308  (
2309  const SYS_MODULE_INDEX drvIndex,
2310  const SYS_MODULE_INIT * const init
2311  )
2312  Summary:
2313  Initializes the Timer driver.
2314  <p><b>Implementation:</b> Static/Dynamic</p>
2315  Description:
2316  This function initializes the Timer driver, making it ready for clients to
2317  open and use it.
2318  Precondition:
2319  None.
2320  Parameters:
2321  drvIndex - Index for the driver instance to be initialized
2322  init - Pointer to a data structure containing any data necessary
2323  to initialize the driver.
2324  Returns:
2325  If successful, returns a valid handle to a driver object. Otherwise, it
2326  returns SYS_MODULE_OBJ_INVALID. The returned object must be passed as
2327  argument to DRV_TMR_Deinitialize, DRV_TMR_Tasks and DRV_TMR_Status functions.
2328  Example:
2329  <code>
2330  DRV_TMR_INIT init;
2331  SYS_MODULE_OBJ objectHandle;
2332  // Populate the timer initialization structure
2333  init.moduleInit.value = SYS_MODULE_POWER_RUN_FULL;
2334  init.tmrId = TMR_ID_2;
2335  init.clockSource = DRV_TMR_CLKSOURCE_INTERNAL;
2336  init.prescale = TMR_PRESCALE_VALUE_256;
2337  init.interruptSource = INT_SOURCE_TIMER_2;
2338  init.mode = DRV_TMR_OPERATION_MODE_16_BIT;
2339  init.asyncWriteEnable = false;
2340  // Do something
2341  objectHandle = DRV_TMR_Initialize ( DRV_TMR_INDEX_0, (SYS_MODULE_INIT*)&init );
2342  if ( SYS_MODULE_OBJ_INVALID == objectHandle )
2343  {
2344  // Handle error
2345  }
2346  </code>
2347  Remarks:
2348  This function must be called before any other Timer driver function is
2349  called.
2350  This function should only be called once during system initialization unless
2351  DRV_TMR_Deinitialize is called to deinitialize the driver instance.
2352  This function will NEVER block for hardware access. The system must use
2353  DRV_TMR_Status to find out when the driver is in the ready state.
2354  Build configuration options may be used to statically override options in
2355  the "init" structure and will take precedence over initialization data
2356  passed using this function.
2357 */
2358 
2359 SYS_MODULE_OBJ
2361  const SYS_MODULE_INDEX drvIndex ,
2362  const SYS_MODULE_INIT * const init ) ;
2363 // *****************************************************************************
2364 /* Function:
2365  void DRV_TMR_Deinitialize ( SYS_MODULE_OBJ object )
2366  Summary:
2367  Deinitializes the specified instance of the Timer driver.
2368  <p><b>Implementation:</b> Dynamic</p>
2369  Description:
2370  Deinitializes the specified instance of the Timer driver, disabling
2371  its operation (and any hardware). All internal data is invalidated.
2372  Precondition:
2373  The DRV_TMR_Initialize function must have been called before calling this
2374  function and a valid SYS_MODULE_OBJ must have been returned.
2375  Parameters:
2376  object - Driver object handle, returned from DRV_TMR_Initialize
2377  Returns:
2378  None.
2379  Example:
2380  <code>
2381  SYS_MODULE_OBJ tmrObject; // Returned from DRV_TMR_Initialize
2382  SYS_STATUS tmrStatus;
2383  DRV_TMR_Deinitialize ( tmrObject );
2384  tmrStatus = DRV_TMR_Status ( tmrObject );
2385  if ( SYS_MODULE_UNINITIALIZED == tmrStatus )
2386  {
2387  // Check again later if you need to know
2388  // when the driver is deinitialized.
2389  }
2390  </code>
2391  Remarks:
2392  Once the Initialize operation has been called, the Deinitialize operation
2393  must be called before the Initialize operation can be called again.
2394  This function will NEVER block waiting for hardware. If the operation
2395  requires time to allow the hardware to complete, this will be reported by
2396  the DRV_TMR_Status operation. The system has to use DRV_TMR_Status to find
2397  out when the module is in the ready state.
2398 */
2399 
2400 void
2402  SYS_MODULE_OBJ object ) ;
2403 // *****************************************************************************
2404 /* Function:
2405  SYS_STATUS DRV_TMR_Status ( SYS_MODULE_OBJ object )
2406  Summary:
2407  Provides the current status of the Timer driver.
2408  <p><b>Implementation:</b> Dynamic</p>
2409  Description:
2410  This function provides the current status of the Timer driver.
2411  Precondition:
2412  The DRV_TMR_Initialize function must have been called before calling this
2413  function.
2414  Parameters:
2415  object - Driver object handle, returned from DRV_TMR_Initialize
2416  Returns:
2417  SYS_STATUS_READY - Indicates that the driver is initialized and ready
2418  for operation
2419  Note: Any value greater than SYS_STATUS_READY is
2420  also a normal running state in which the driver
2421  is ready to accept new operations.
2422  SYS_STATUS_ERROR - Indicates that the driver is in an error state
2423  Note: Any value less than SYS_STATUS_ERROR is
2424  also an error state.
2425  SYS_MODULE_UNINITIALIZED - Indicates that the driver has been deinitialized
2426  Note: This value is less than SYS_STATUS_ERROR.
2427  Example:
2428  <code>
2429  SYS_MODULE_OBJ object; // Returned from DRV_TMR_Initialize
2430  SYS_STATUS tmrStatus;
2431  tmrStatus = DRV_TMR_Status ( object );
2432  else if ( SYS_STATUS_ERROR >= tmrStatus )
2433  {
2434  // Handle error
2435  }
2436  </code>
2437  Remarks:
2438  The this operation can be used to determine when any of the driver's module
2439  level operations has completed.
2440  Once the status operation returns SYS_STATUS_READY, the driver is ready for
2441  operation.
2442  The value of SYS_STATUS_ERROR is negative (-1). Any value less than that is
2443  also an error state.
2444  This function will NEVER block waiting for hardware.
2445 */
2446 
2447 SYS_STATUS
2448  DRV_TMR_Status (
2449  SYS_MODULE_OBJ object ) ;
2450 // *****************************************************************************
2451 /* Function:
2452  void DRV_TMR_Tasks ( SYS_MODULE_OBJ object )
2453  Summary:
2454  Maintains the driver's state machine.
2455  <p><b>Implementation:</b> Dynamic</p>
2456  Description:
2457  This function is used to maintain the driver's internal state machine and
2458  processes the timer events..
2459  Precondition:
2460  The DRV_TMR_Initialize function must have been called for the specified Timer
2461  driver instance.
2462  Parameters:
2463  object - Object handle for the specified driver instance (returned from
2464  DRV_TMR_Initialize)
2465  Returns:
2466  None
2467  Example:
2468  <code>
2469  SYS_MODULE_OBJ object; // Returned from DRV_TMR_Initialize
2470  while (true)
2471  {
2472  DRV_TMR_Tasks ( object );
2473  // Do other tasks
2474  }
2475  </code>
2476  Remarks:
2477  This function is normally not called directly by an application. It is
2478  called by the system's Tasks routine (SYS_Tasks)
2479 */
2480 
2481 void
2482  DRV_TMR_Tasks (
2483  SYS_MODULE_OBJ object ) ;
2484 // *****************************************************************************
2485 // *****************************************************************************
2486 // Section: TMR Driver Client Functions
2487 // *****************************************************************************
2488 // *****************************************************************************
2489 // *****************************************************************************
2490 /* Function:
2491  DRV_HANDLE DRV_TMR_Open
2492  (
2493  const SYS_MODULE_INDEX index,
2494  const DRV_IO_INTENT intent
2495  )
2496  Summary:
2497  Opens the specified Timer driver instance and returns a handle to it.
2498  <p><b>Implementation:</b> Dynamic</p>
2499  Description:
2500  This function opens the specified Timer driver instance and provides a
2501  handle that must be provided to all other client-level operations to
2502  identify the caller and the instance of the driver. Timer driver does not
2503  support multiple clients. If two tasks want to use the timer, one should
2504  wait until the other one gets closed.
2505  Precondition:
2506  The DRV_TMR_Initialize function must have been called before calling this
2507  function.
2508  Parameters:
2509  index - Identifier for the object instance to be opened
2510  intent - Zero or more of the values from the enumeration
2511  DRV_IO_INTENT ORed together to indicate the intended use
2512  of the driver
2513  Returns:
2514  If successful, the function returns a valid open instance handle (a number
2515  identifying both the caller and the module instance).
2516  If an error occurs, the return value is DRV_HANDLE_INVALID.
2517  Example:
2518  <code>
2519  DRV_HANDLE handle;
2520  handle = DRV_TMR_Open ( DRV_TMR_INDEX_0, DRV_IO_INTENT_EXCLUSIVE );
2521  if ( DRV_HANDLE_INVALID == handle )
2522  {
2523  // Unable to open the driver
2524  }
2525  </code>
2526  Remarks:
2527  The handle returned is valid until the DRV_TMR_Close function is called.
2528  This function will NEVER block waiting for hardware.
2529  If the requested intent flags are not supported, the function will return
2530  DRV_HANDLE_INVALID.
2531  The Timer driver does not support DRV_IO_INTENT_SHARED.
2532  Only exclusive access is supported for now.
2533 */
2534 
2535 DRV_HANDLE
2536  DRV_TMR_Open (
2537  const SYS_MODULE_INDEX index ,
2538  const DRV_IO_INTENT intent ) ;
2539 // *****************************************************************************
2540 /* Function:
2541  void DRV_TMR_Close ( DRV_HANDLE handle )
2542  Summary:
2543  Closes an opened instance of the Timer driver.
2544  <p><b>Implementation:</b> Dynamic</p>
2545  Description:
2546  This function closes an opened instance of the Timer driver, invalidating
2547  the handle.
2548  Precondition:
2549  The DRV_TMR_Initialize function must have been called for the specified
2550  Timer driver instance.
2551  DRV_TMR_Open must have been called to obtain a valid opened device handle.
2552  Parameters:
2553  handle - A valid open-instance handle, returned from the driver's
2554  open routine
2555  Returns:
2556  None
2557  Example:
2558  <code>
2559  DRV_HANDLE handle; // Returned from DRV_TMR_Open
2560  DRV_TMR_Close ( handle );
2561  </code>
2562  Remarks:
2563  After calling this function, the handle passed in "handle" must not be used
2564  with any of the remaining driver functions. A new handle must be obtained
2565  by calling DRV_TMR_Open before the caller may use the driver again.
2566  Note: Usually there is no need for the driver client to verify that the Close
2567  operation has completed.
2568 */
2569 
2570 void
2571  DRV_TMR_Close (
2572  DRV_HANDLE handle ) ;
2573 // *****************************************************************************
2574 /* Function:
2575  DRV_TMR_CLIENT_STATUS DRV_TMR_ClientStatus ( DRV_HANDLE handle )
2576  Summary:
2577  Gets the status of the client operation.
2578  <p><b>Implementation:</b> Dynamic</p>
2579  Description:
2580  This function gets the status of the recently completed client level
2581  operation.
2582  Precondition:
2583  The DRV_TMR_Initialize function must have been called for the specified
2584  Timer driver instance.
2585  DRV_TMR_Open must have been called to obtain a valid opened device handle.
2586  Parameters:
2587  handle - A valid open-instance handle, returned from the driver's
2588  open routine
2589  Returns:
2590  None
2591  Example:
2592  <code>
2593  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
2594  DRV_TMR_CLIENT_STATUS tmrDrvStatus;
2595  tmrDrvStatus = DRV_TMR_ClientStatus ( tmrHandle );
2596  </code>
2597  Remarks:
2598  None.
2599 */
2600 
2603  DRV_HANDLE handle ) ;
2604 // *****************************************************************************
2605 // *****************************************************************************
2606 // Section: TMR Driver Counting functions
2607 // *****************************************************************************
2608 // *****************************************************************************
2609 // *****************************************************************************
2610 /* Function:
2611  void DRV_TMR_CounterValueSet ( DRV_HANDLE handle, uint32_t counterPeriod )
2612  Summary:
2613  Updates the Timer's counter register.
2614  <p><b>Implementation:</b> Static/Dynamic</p>
2615  Description:
2616  This function updates the Timer's value in the counter register.
2617  Precondition:
2618  The DRV_TMR_Initialize function must have been called.
2619  DRV_TMR_Open must have been called to obtain a valid opened device handle.
2620  Parameters:
2621  handle - A valid open-instance handle, returned from the driver's
2622  open routine
2623  counterPeriod - counter period value
2624  - a 16 bit value if the timer is configured in 16 bit mode
2625  - a 32 bit value if the timer is configured in 32 bit mode
2626  Returns:
2627  None.
2628  Example:
2629  <code>
2630  </code>
2631  Remarks:
2632  None.
2633 */
2634 
2635 void
2637  DRV_HANDLE handle ,
2638  uint32_t counterPeriod ) ;
2639 // *****************************************************************************
2640 /* Function:
2641  uint32_t DRV_TMR_CounterValueGet ( DRV_HANDLE handle )
2642  Summary:
2643  Reads the Timer's counter register.
2644  <p><b>Implementation:</b> Static/Dynamic</p>
2645  Description:
2646  This function returns the Timer's value in the counter register.
2647  Precondition:
2648  The DRV_TMR_Initialize function must have been called.
2649  DRV_TMR_Open must have been called to obtain a valid opened device handle.
2650  Parameters:
2651  handle - A valid open-instance handle, returned from the driver's
2652  open routine
2653  Returns:
2654  Timer current period:
2655  - a 16 bit value if the timer is configured in 16 bit mode
2656  - a 32 bit value if the timer is configured in 32 bit mode
2657  Example:
2658  <code>
2659  //Example to use timer for precision time measurement
2660  //without configuring an alarm (interrupt based)
2661  char appState = 0;
2662  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
2663  switch ( appState )
2664  {
2665  case 0:
2666  //Calculate and set the counter period
2667  DRV_TMR_CounterValueSet ( tmrHandle, ( 0xFFFF - 0x1000 ) );
2668  //counter starts
2669  DRV_TMR_Start ( tmrHandle );
2670  //Trigger an application operation
2671  app_trigger_operation();
2672  //Check for time-out in the next state
2673  appState++;
2674  case 1:
2675  //Overflows and stops at 0 if no alarm is set
2676  if ( DRV_TMR_CounterValueGet ( tmrHandle ) == 0 )
2677  {
2678  //Time-out
2679  return false;
2680  }
2681  else if ( app_operation_isComplete( ) )
2682  {
2683  //Operation is complete before time-out
2684  return true;
2685  }
2686  </code>
2687  Remarks:
2688  None.
2689 */
2690 
2691 uint32_t
2693  DRV_HANDLE handle ) ;
2694 // *****************************************************************************
2695 /* Function:
2696  void DRV_TMR_CounterClear ( DRV_HANDLE handle )
2697  Summary:
2698  Clears the Timer's counter register.
2699  <p><b>Implementation:</b> Static/Dynamic</p>
2700  Description:
2701  This function clears the Timer's value in the counter register.
2702  Precondition:
2703  The DRV_TMR_Initialize function must have been called.
2704  DRV_TMR_Open must have been called to obtain a valid opened device handle.
2705  Parameters:
2706  handle - A valid open-instance handle, returned from the driver's
2707  open routine
2708  Returns:
2709  None.
2710  Example:
2711  <code>
2712  </code>
2713  Remarks:
2714  None.
2715 */
2716 
2717 void
2719  DRV_HANDLE handle ) ;
2720 // *****************************************************************************
2721 /* Function:
2722  bool DRV_TMR_AlarmRegister
2723  (
2724  DRV_HANDLE handle,
2725  uint32_t divider,
2726  bool isPeriodic,
2727  uintptr_t context,
2728  DRV_TMR_CALLBACK callBack
2729  )
2730  Summary:
2731  Sets up an alarm.
2732  <p><b>Implementation:</b> Dynamic</p>
2733  Description:
2734  This function sets up an alarm, allowing the client to receive a callback
2735  from the driver when the timer counter reaches zero. Alarms can be one-shot
2736  or periodic. A periodic alarm will reload the timer and generate alarm
2737  until stopped. The alarm frequency is: DRV_TMR_CounterFrequencyGet() /
2738  divider;
2739  Precondition:
2740  The DRV_TMR_Initialize function must have been called.
2741  DRV_TMR_Open must have been called to obtain a valid opened device handle.
2742  divider value has to be within the timer divider range (see DRV_TMR_DividerSpecGet).
2743  Parameters:
2744  handle - A valid handle, returned from DRV_TMR_Open
2745  divider - The value to divide the timer clock source to obtain the
2746  required alarm frequency.
2747  - a 16 bit value if the timer is configured in 16 bit mode
2748  - a 32 bit value if the timer is configured in 32 bit mode
2749  isPeriodic - Flag indicating whether the alarm should be one-shot or periodic.
2750  context - A reference, call back function will be called with the same
2751  reference.
2752  callBack - A call back function which will be called on time out.
2753  Returns:
2754  - true - if the call succeeded
2755  - false - the obtained divider could not be obtained or the passed handle was invalid
2756  Example:
2757  <code>
2758  //Do the initialization with 'mode' set to DRV_TMR_OPERATION_MODE_16_BIT
2759  void setupTask ()
2760  {
2761  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
2762  uint32_t myFreq = 1000; // 1KHz
2763  uint32_t clkFreq = DRV_TMR_CounterFrequencyGet(tmrHandle); // timer running frequency
2764  // calculate the divider needed
2765  uint32_t divider = clkFreq / myFreq;
2766  // Start the alarm
2767  if(!DRV_TMR_AlarmRegister ( tmrHandle, divider, true, 0, CallBackFreq ))
2768  {
2769  // divider value could not be obtain;
2770  // handle the error
2771  //
2772  }
2773  }
2774  </code>
2775  Remarks:
2776  The divider value will be truncated to a 16 bit value if the timer is
2777  configured in 16 bit mode. The timer should be started using DRV_TMR_Start API to get a
2778  callback.
2779 */
2780 
2781 bool
2783  DRV_HANDLE handle ,
2784  uint32_t divider ,
2785  bool isPeriodic ,
2786  uintptr_t context ,
2787  DRV_TMR_CALLBACK callBack ) ;
2788 // *****************************************************************************
2789 /* Function:
2790  bool DRV_TMR_AlarmDisable ( DRV_HANDLE handle);
2791  Summary:
2792  Disables an alarm signal.
2793  <p><b>Implementation:</b> Dynamic</p>
2794  Description:
2795  This function allows the client to disable an alarm generation.
2796  Use DRV_TMR_AlarmEnable to re-enable.
2797  Precondition:
2798  The DRV_TMR_Initialize function must have been called.
2799  DRV_TMR_Open must have been called to obtain a valid opened device handle.
2800  A client alarm must be active.
2801  Parameters:
2802  handle - A valid handle, returned from DRV_TMR_Open
2803  Returns:
2804  The current status of the alarm:
2805  - true if the alarm was currently enabled
2806  - false if the alarm was currently disabled
2807  Example:
2808  <code>
2809  </code>
2810  Remarks:
2811  When the driver operates in interrupts this call resolves to a device
2812  interrupt disable.
2813  Do NOT disable the timer except for very short periods of time. If the time
2814  that the interrupt is disabled is longer than a wrap around period and the
2815  interrupt is missed, the hardware has no means of recovering and the
2816  resulting timing will be inaccurate.
2817 */
2818 
2819 bool
2821  DRV_HANDLE handle ) ;
2822 // *****************************************************************************
2823 /* Function:
2824  void DRV_TMR_AlarmEnable ( DRV_HANDLE handle, bool enable );
2825  Summary:
2826  Re-enables an alarm signal.
2827  <p><b>Implementation:</b> Dynamic</p>
2828  Description:
2829  This function allows the client to re-enable an alarm after it has been
2830  disabled by a DRV_TMR_AlarmDisable call.
2831  Precondition:
2832  The DRV_TMR_Initialize function must have been called.
2833  DRV_TMR_Open must have been called to obtain a valid opened device handle.
2834  Parameters:
2835  handle - A valid handle, returned from DRV_TMR_Open
2836  enable - boolean to enable the current callback
2837  Returns:
2838  None
2839  Example:
2840  <code>
2841  </code>
2842  Remarks:
2843  When the driver operates in interrupts this call resolves to a device
2844  interrupt re-enable.
2845 */
2846 
2847 void
2849  DRV_HANDLE handle ,
2850  bool enable ) ;
2851 // *****************************************************************************
2852 /* Function:
2853  void DRV_TMR_AlarmPeriodSet ( DRV_HANDLE handle, uint32_t value )
2854  Summary:
2855  Updates the Timer's period.
2856  <p><b>Implementation:</b> Dynamic</p>
2857  Description:
2858  This function updates the Timer's period.
2859  Precondition:
2860  The DRV_TMR_Initialize function must have been called.
2861  DRV_TMR_Open must have been called to obtain a valid opened device handle.
2862  Parameters:
2863  handle - A valid open-instance handle, returned from the driver's
2864  open routine
2865  value - Period value
2866  - a 16 bit value if the timer is configured in 16 bit mode
2867  - a 32 bit value if the timer is configured in 32 bit mode
2868  Returns:
2869  None.
2870  Example:
2871  <code>
2872  DRV_HANDLE handle; // Returned from DRV_TMR_Open
2873  DRV_TMR_AlarmPeriodSet ( handle, 0x1000 );
2874  </code>
2875  Remarks:
2876  - The period value will be truncated to a 16 bit value if the timer is
2877  configured in 16 bit mode.
2878 */
2879 
2880 void
2882  DRV_HANDLE handle ,
2883  uint32_t value ) ;
2884 // *****************************************************************************
2885 /* Function:
2886  uint32_t DRV_TMR_AlarmPeriodGet ( DRV_HANDLE handle )
2887  Summary:
2888  Provides the Timer's period.
2889  <p><b>Implementation:</b> Dynamic</p>
2890  Description:
2891  This function gets the Timer's period.
2892  Precondition:
2893  The DRV_TMR_Initialize function must have been called.
2894  DRV_TMR_Open must have been called to obtain a valid opened device handle.
2895  Parameters:
2896  handle - A valid open-instance handle, returned from the driver's
2897  open routine
2898  Returns:
2899  Timer period value:
2900  - a 16 bit value if the timer is configured in 16 bit mode
2901  - a 32 bit value if the timer is configured in 32 bit mode
2902  Example:
2903  <code>
2904  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
2905  uint32_t period;
2906  period = DRV_TMR_AlarmPeriodGet ( tmrHandle );
2907  </code>
2908  Remarks:
2909  None.
2910 */
2911 
2912 uint32_t
2914  DRV_HANDLE handle ) ;
2915 // *****************************************************************************
2916 /* Function:
2917  void DRV_TMR_AlarmDeregister ( DRV_HANDLE handle )
2918  Summary:
2919  Removes a previously set alarm.
2920  <p><b>Implementation:</b> Dynamic</p>
2921  Description:
2922  This function removes a previously set alarm.
2923  Precondition:
2924  The DRV_TMR_Initialize function must have been called.
2925  DRV_TMR_Open must have been called to obtain a valid opened device handle.
2926  DRV_TMR_AlarmRegister function must have been called before.
2927  Parameters:
2928  handle - A valid open-instance handle, returned from the driver's
2929  open routine
2930  Returns:
2931  None.
2932  Example:
2933  <code>
2934  // Example of a key debounce check
2935  static unsigned int lastReadKey, readKey, keyCount, globalKeyState;
2936  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
2937  void keyPressDetect ()
2938  {
2939  // Calculate the count to be passed on from the clock input
2940  DRV_TMR_AlarmRegister ( tmrHandle, 0xFF00, true, DebounceCheck );
2941  }
2942  void DebounceCheck ( uintptr_t context )
2943  {
2944  readKey = AppReadKey();
2945  if ( readKey != lastReadKey )
2946  {
2947  lastReadKey = readKey;
2948  keyCount = 0;
2949  }
2950  else
2951  {
2952  if ( keyCount > 20 )
2953  {
2954  globalKeyState = readKey;
2955  DRV_TMR_AlarmDeregister ( tmrHandle );
2956  }
2957  keyCount++;
2958  }
2959  }
2960  </code>
2961  Remarks:
2962  None.
2963 */
2964 
2965 void
2967  DRV_HANDLE handle ) ;
2968 // *****************************************************************************
2969 // *****************************************************************************
2970 // Section: TMR Driver Operation Control Functions
2971 // *****************************************************************************
2972 // *****************************************************************************
2973 // *****************************************************************************
2974 /* Function:
2975  bool DRV_TMR_Start ( DRV_HANDLE handle )
2976  Summary:
2977  Starts the Timer counting.
2978  <p><b>Implementation:</b> Static/Dynamic</p>
2979  Description:
2980  This function starts the Timer counting.
2981  Precondition:
2982  The DRV_TMR_Initialize function must have been called.
2983  DRV_TMR_Open must have been called to obtain a valid opened device handle.
2984  Timer parameters must have been set by a call to DRV_TMR_AlarmRegister.
2985  Parameters:
2986  handle - A valid open-instance handle, returned from the driver's
2987  open routine
2988  Returns:
2989  - true - if the operation succeeded
2990  - false - the supplied handle is invalid or the client doesn't have
2991  the needed parameters to run (alarm callback and period )
2992  Example:
2993  <code>
2994  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
2995  DRV_TMR_AlarmRegister(tmrHandle, 0x100, true, 0, myTmrCallback);
2996  DRV_TMR_Start ( tmrHandle );
2997  </code>
2998  Remarks:
2999  None.
3000 */
3001 
3002 bool
3003  DRV_TMR_Start (
3004  DRV_HANDLE handle ) ;
3005 // *****************************************************************************
3006 /* Function:
3007  void DRV_TMR_Stop ( DRV_HANDLE handle )
3008  Summary:
3009  Stops the Timer from counting.
3010  <p><b>Implementation:</b> Static/Dynamic</p>
3011  Description:
3012  This function stops the running Timer from counting.
3013  Precondition:
3014  The DRV_TMR_Initialize function must have been called.
3015  DRV_TMR_Open must have been called to obtain a valid opened device handle.
3016  Parameters:
3017  handle - A valid open-instance handle, returned from the driver's
3018  open routine
3019  Returns:
3020  None.
3021  Example:
3022  <code>
3023  DRV_HANDLE handle; // Returned from DRV_TMR_Open
3024  DRV_TMR_Stop ( handle );
3025  </code>
3026  Remarks:
3027  None.
3028 */
3029 
3030 void
3031  DRV_TMR_Stop (
3032  DRV_HANDLE handle ) ;
3033 // *****************************************************************************
3034 // *****************************************************************************
3035 // Section: TMR Driver Operation Status Functions
3036 // *****************************************************************************
3037 // *****************************************************************************
3038 // *****************************************************************************
3039 /* Function:
3040  unsigned int DRV_TMR_AlarmHasElapsed ( DRV_HANDLE handle )
3041  Summary:
3042  Provides the status of Timer's period elapse.
3043  <p><b>Implementation:</b> Dynamic</p>
3044  Description:
3045  This function returns the number of times Timer's period has elapsed since
3046  last call to this API has made. On calling this API, the internally
3047  maintained counter will be cleared and count will be started again from next
3048  elapse.
3049  Precondition:
3050  The DRV_TMR_Initialize function must have been called.
3051  DRV_TMR_Open must have been called to obtain a valid opened device handle.
3052  Parameters:
3053  handle - A valid handle, returned from the DRV_TMR_Open
3054  Returns:
3055  Number of times timer has elapsed since the last call.
3056  Example:
3057  <code>
3058  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
3059  bool elapseStatus;
3060  SYS_MODULE_OBJ tmrObject // Returned by DRV_TMR_Initialize
3061  unsigned int appInternalTime = 0;
3062  Sys_Tasks()
3063  {
3064  //Timer task will be called from ISR
3065  APP_TimeUpdate_Task();
3066  //Other Tasks
3067  }
3068  void APP_TimeUpdate_Task ( void )
3069  {
3070  //We will not miss a count even though we are late
3071  appInternalTime += DRV_TMR_AlarmHasElapsed ( tmrHandle );
3072  }
3073  </code>
3074  Remarks:
3075  None.
3076 */
3077 
3078 uint32_t
3080  DRV_HANDLE handle ) ;
3081 // *****************************************************************************
3082 // *****************************************************************************
3083 // Section: TMR Driver Control and Information Functions
3084 // *****************************************************************************
3085 // *****************************************************************************
3086 // *****************************************************************************
3087 /* Function:
3088  bool DRV_TMR_ClockSet
3089  (
3090  DRV_HANDLE handle,
3091  DRV_TMR_CLK_SOURCES clockSource,
3092  TMR_PRESCALE preScale
3093  )
3094  Summary:
3095  Sets the timers clock by selecting the source and prescaler.
3096  <p><b>Implementation:</b> Dynamic</p>
3097  Description:
3098  This function sets the timer clock by selecting the source and prescaler.
3099  The clock sources are device specific, refer device datasheet for supported
3100  clock sources. If unsupported clock source is passed then the behaviour of
3101  this function is unpredictable.
3102  Precondition:
3103  The DRV_TMR_Initialize function must have been called. Must have selected
3104  32-Bit timer mode if mode selection is applicable.
3105  DRV_TMR_Open must have been called to obtain a valid opened device handle.
3106  Parameters:
3107  handle - A valid open-instance handle, returned from the driver's
3108  open routine
3109  clockSource - Clock source of the timer
3110  preScale - Timer's Prescaler divisor
3111  Returns:
3112  - true - if the operation is successful
3113  - false - either the handle is invalid or the clockSource
3114  and/or prescaler are not supported
3115  Example:
3116  <code>
3117  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
3118  DRV_TMR_ClockSet ( tmrHandle, DRV_TMR_CLKSOURCE_INTERNAL, TMR_PRESCALE_VALUE_256 );
3119  </code>
3120  Remarks:
3121  None.
3122 */
3123 
3124 bool
3126  DRV_HANDLE handle ,
3127  DRV_TMR_CLK_SOURCES clockSource ,
3128  TMR_PRESCALE preScale ) ;
3129 // *****************************************************************************
3130 /* Function:
3131  TMR_PRESCALE DRV_TMR_PrescalerGet ( DRV_HANDLE handle )
3132  Summary:
3133  This function gets the currently selected prescaler.
3134  <p><b>Implementation:</b> Dynamic</p>
3135  Description:
3136  This function gets the currently selected prescaler.
3137  Precondition:
3138  The DRV_TMR_Initialize function must have been called.
3139  DRV_TMR_Open must have been called to obtain a valid opened device handle.
3140  Parameters:
3141  handle - A valid open-instance handle, returned from the driver's
3142  open routine
3143  Returns:
3144  Timer prescaler.
3145  Example:
3146  <code>
3147  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
3148  TMR_PRESCALE preScale;
3149  preScale = DRV_TMR_PrescalerGet ( tmrHandle );
3150  </code>
3151  Remarks:
3152  None.
3153 */
3154 
3155 TMR_PRESCALE
3157  DRV_HANDLE handle ) ;
3158 // *****************************************************************************
3159 /* Function:
3160  DRV_TMR_OPERATION_MODE DRV_TMR_OperationModeGet(DRV_HANDLE handle)
3161  Summary:
3162  This function gets the currently selected operation mode.
3163  <p><b>Implementation:</b> Dynamic</p>
3164  Description:
3165  This function gets the currently selected 16/32 bit operation mode.
3166  Precondition:
3167  The DRV_TMR_Initialize function must have been called.
3168  DRV_TMR_Open must have been called to obtain a valid opened device handle.
3169  Parameters:
3170  handle - A valid open-instance handle, returned from the driver's
3171  open routine
3172  Returns:
3173  A DRV_TMR_OPERATION_MODE value showing how the timer is currently
3174  configured. DRV_TMR_OPERATION_MODE_NONE is returned for an invalid client
3175  handle.
3176  Example:
3177  <code>
3178  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
3179  DRV_TMR_OPERATION_MODE operMode;
3180  operMode = DRV_TMR_OperationModeGet ( tmrHandle );
3181  </code>
3182  Remarks:
3183  None.
3184 */
3185 
3188  DRV_HANDLE handle ) ;
3189 // *****************************************************************************
3190 /* Function:
3191  bool DRV_TMR_GateModeSet ( DRV_HANDLE handle )
3192  Summary:
3193  Enables the Gate mode.
3194  <p><b>Implementation:</b> Dynamic</p>
3195  Description:
3196  This function enables the Gated mode of Timer. User can measure the duration
3197  of an external signal in this mode. Once the Gate mode is enabled, Timer
3198  will start on the raising edge of the external signal. It will keep counting
3199  until the next falling edge.
3200  Precondition:
3201  The DRV_TMR_Initialize function must have been called.
3202  DRV_TMR_Open must have been called to obtain a valid opened device handle.
3203  Parameters:
3204  handle - A valid open-instance handle, returned from the driver's
3205  open routine
3206  Returns:
3207  - true - if the operation is successful
3208  - false - either the handle is invalid or the gate mode
3209  is not supported
3210  Example:
3211  <code>
3212  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
3213  DRV_TMR_GateModeSet ( tmrHandle );
3214  </code>
3215  Remarks:
3216  None.
3217 */
3218 
3219 bool
3221  DRV_HANDLE handle ) ;
3222 // *****************************************************************************
3223 /* Function:
3224  bool DRV_TMR_GateModeClear ( DRV_HANDLE handle )
3225  Summary:
3226  Enables the Gate mode.
3227  <p><b>Implementation:</b> Dynamic</p>
3228  Description:
3229  This function enables the Gated mode of Timer. User can measure the duration
3230  of an external signal in this mode. Once the Gate mode is enabled, Timer
3231  will start on the raising edge of the external signal. It will keep counting
3232  until the next falling edge.
3233  Precondition:
3234  The DRV_TMR_Initialize function must have been called.
3235  DRV_TMR_Open must have been called to obtain a valid opened device handle.
3236  Parameters:
3237  handle - A valid open-instance handle, returned from the driver's
3238  open routine
3239  Returns:
3240  - true - if the operation is successful
3241  - false - either the handle is invalid or the gate mode
3242  is not supported
3243  Example:
3244  <code>
3245  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
3246  DRV_TMR_GateModeClear ( tmrHandle );
3247  </code>
3248  Remarks:
3249  None.
3250 */
3251 
3252 bool
3254  DRV_HANDLE handle ) ;
3255 // *****************************************************************************
3256 /* Function:
3257  uint32_t DRV_TMR_CounterFrequencyGet ( DRV_HANDLE handle )
3258  Summary:
3259  Provides the Timer input frequency.
3260  <p><b>Implementation:</b> Dynamic</p>
3261  Description:
3262  This function provides the Timer input frequency. Input frequency is the
3263  clock to the Timer register and it is considering the prescaler divisor.
3264  Precondition:
3265  The DRV_TMR_Initialize function must have been called.
3266  DRV_TMR_Open must have been called to obtain a valid opened device handle.
3267  Parameters:
3268  handle - A valid open-instance handle, returned from the driver's
3269  open routine
3270  Returns:
3271  32-bit value corresponding to the running frequency.
3272  If Timer clock source is external, then this function returns 0.
3273  Example:
3274  <code>
3275  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
3276  uint32_t clkFreqHz;
3277  clkFreqHz = DRV_TMR_CounterFrequencyGet ( tmrHandle );
3278  </code>
3279  Remarks:
3280  On most processors, the Timer's base frequency is the same as the peripheral
3281  bus clock.
3282 */
3283 
3284 uint32_t
3286  DRV_HANDLE handle ) ;
3287 // *****************************************************************************
3288 /* Function:
3289  DRV_TMR_OPERATION_MODE DRV_TMR_DividerRangeGet
3290  (
3291  DRV_HANDLE handle,
3292  DRV_TMR_DIVIDER_RANGE* pDivRange
3293  )
3294  Summary:
3295  Returns the Timer divider values.
3296  <p><b>Implementation:</b> Dynamic</p>
3297  Description:
3298  This function provides the Timer operating mode and divider range.
3299  Precondition:
3300  The DRV_TMR_Initialize function must have been called.
3301  DRV_TMR_Open must have been called to obtain a valid opened device handle.
3302  Parameters:
3303  handle - A valid open-instance handle, returned from the driver's
3304  open routine
3305  pDivRange - Address to store the timer divider range.
3306  Returns:
3307  - A DRV_TMR_OPERATION_MODE value showing how the timer is currently configured.
3308  The pDivRange is updated with the supported range values.
3309  - DRV_TMR_OPERATION_MODE_NONE for invalid client handle
3310  Example:
3311  <code>
3312  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
3313  DRV_TMR_OPERATION_MODE timerMode;
3314  DRV_TMR_DIVIDER_RANGE timerRange;
3315  DRV_TMR_DividerRangeGet(handle, &timerRange);
3316  uint32_t clkFreqHz = DRV_TMR_CounterFrequencyGet ( tmrHandle );
3317  uint32_t maxFreqHz = clkFreqHz / timerRange.dividerMin;
3318  uint32_t minFreqHz = clkFreqHz / timerRange.dividerMax;
3319  </code>
3320  Remarks:
3321  None.
3322 */
3323 
3326  DRV_HANDLE handle ,
3327  DRV_TMR_DIVIDER_RANGE * pDivRange ) ;
3328 // *****************************************************************************
3329 // *****************************************************************************
3330 // Section: File includes for the APIs which are required for backward
3331 // compatibility.
3332 // *****************************************************************************
3333 // *****************************************************************************
3334 /* OPEN FILE C:\microchip\harmony\v2_06\framework\driver\tmr\drv_tmr_compatibility.h */
3335 /*******************************************************************************
3336  Timer Device Driver Interface Definition
3337  Company:
3338  Microchip Technology Inc.
3339  File Name:
3340  drv_tmr_compatibility.h
3341  Summary:
3342  Timer device driver interface header file.
3343  Description:
3344  This header file contains macro definition for APIs which will be deprecated
3345  later. This header file is included in drv_tmr.h.
3346 *******************************************************************************/
3347 //DOM-IGNORE-BEGIN
3348 /*******************************************************************************
3349 Copyright (c) 2013-2014 released Microchip Technology Inc. All rights reserved.
3350 Microchip licenses to you the right to use, modify, copy and distribute
3351 Software only when embedded on a Microchip microcontroller or digital signal
3352 controller that is integrated into your product or third party product
3353 (pursuant to the sublicense terms in the accompanying license agreement).
3354 You should refer to the license agreement accompanying this Software for
3355 additional information regarding your rights and obligations.
3356 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
3357 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
3358 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
3359 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
3360 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
3361 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
3362 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
3363 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
3364 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
3365 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
3366 *******************************************************************************/
3367 //DOM-IGNORE-END
3368 #ifndef _DRV_TMR_DEPRECATED_H
3369 #define _DRV_TMR_DEPRECATED_H
3370 // *****************************************************************************
3371 // *****************************************************************************
3372 // Section: File includes
3373 // *****************************************************************************
3374 // *****************************************************************************
3375 // *****************************************************************************
3376 /* Function:
3377  void DRV_TMR_Tasks_ISR ( SYS_MODULE_OBJ object )
3378  Summary:
3379  Maintains the driver's state machine, processes the events and implements
3380  its ISR.
3381  <p><b>Implementation:</b> Dynamic</p>
3382  Description:
3383  This function is used to maintain the driver's internal state machine and
3384  processes the timer events in interrupt-driven implementations
3385  (DRV_TMR_INTERRUPT_MODE == true).
3386  Precondition:
3387  The DRV_TMR_Initialize function must have been called for the specified Timer
3388  driver instance.
3389  Parameters:
3390  object - Object handle for the specified driver instance (returned from
3391  DRV_TMR_Initialize)
3392  Returns:
3393  None
3394  Example:
3395  <code>
3396  void __ISR(_TIMER_2_VECTOR, ipl4) _InterruptHandler_TMR2(void)
3397  {
3398  DRV_TMR_Tasks_ISR(appDrvObjects.drvTmrObject);
3399  }
3400  </code>
3401  Remarks:
3402  This function is normally not called directly by an application.
3403  It is called by the timer driver raw ISR.
3404  This function will execute in an ISR context and will never block or access any
3405  resources that may cause it to block.
3406 
3407  This function will be deprecated later, so avoid using it as much as possible.
3408  Use generic function "DRV_TMR_Tasks" instead of this.
3409 */
3410 #define DRV_TMR_Tasks_ISR( object ) DRV_TMR_Tasks ( object )
3411 // *****************************************************************************
3412 /* Function:
3413  void DRV_TMR_CounterValue16BitSet
3414  (
3415  DRV_HANDLE handle,
3416  uint16_t counterPeriod
3417  )
3418  Summary:
3419  Updates the 16-bit Timer's counter register.
3420  <p><b>Implementation:</b> Dynamic</p>
3421  Description:
3422  This function updates the 16-bit Timer's value in the counter register. This
3423  is valid only if the 16-bit mode of the timer is selected('mode' in the INIT
3424  structure is set to DRV_TMR_OPERATION_MODE_16_BIT). Otherwise use
3425  DRV_TMR_CounterValue32BitSet function.
3426  Precondition:
3427  The DRV_TMR_Initialize function must have been called. Must have selected
3428  16-Bit timer mode if mode selection is applicable.
3429  DRV_TMR_Open must have been called to obtain a valid opened device handle.
3430  Parameters:
3431  handle - A valid open-instance handle, returned from the driver's
3432  open routine
3433  counterPeriod - 16-bit counter period value
3434  Returns:
3435  None.
3436  Example:
3437  <code>
3438  //Example to use timer for precision time measurement
3439  //without configuring an alarm (interrupt based)
3440  char appState = 0;
3441  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
3442 
3443  switch ( appState )
3444  {
3445  case 0:
3446  //Calculate and set the counter period
3447  DRV_TMR_CounterValue16BitSet ( tmrHandle, ( 0xFFFF - 0x1000 ) );
3448 
3449  //counter starts
3450  DRV_TMR_Start ( tmrHandle );
3451 
3452  //Trigger an application operation
3453  app_trigger_operation();
3454 
3455  //Check for time-out in the next state
3456  appState++;
3457  case 1:
3458  //Overflows and stops at 0 if no alarm is set
3459  if ( DRV_TMR_CounterValue16BitGet ( tmrHandle ) == 0 )
3460  {
3461  //Time-out
3462  return false;
3463  }
3464  else if ( app_operation_isComplete( ) )
3465  {
3466  //Operation is complete before time-out
3467  return true;
3468  }
3469  </code>
3470  Remarks:
3471  This function will be deprecated later, so avoid using it as much as possible.
3472  Use generic function "DRV_TMR_CounterValueSet" instead of this.
3473 */
3474 #define DRV_TMR_CounterValue16BitSet( handle , counterPeriod ) DRV_TMR_CounterValueSet ( handle , counterPeriod )
3475 // *****************************************************************************
3476 /* Function:
3477  void DRV_TMR_CounterValue32BitSet
3478  (
3479  DRV_HANDLE handle,
3480  uint32_t counterPeriod
3481  )
3482  Summary:
3483  Updates the 32-bit Timer's counter register.
3484  <p><b>Implementation:</b> Dynamic</p>
3485  Description:
3486  This function updates the 32-bit Timer's value in the counter register. This
3487  is valid only if the 32-bit mode of the timer is selected Otherwise use
3488  DRV_TMR_CounterValue16BitSet function.
3489  Precondition:
3490  The DRV_TMR_Initialize function must have been called. Must have selected
3491  32-Bit timer mode.
3492  DRV_TMR_Open must have been called to obtain a valid opened device handle.
3493  Parameters:
3494  handle - A valid open-instance handle, returned from the driver's
3495  open routine
3496  counterPeriod - 32-bit counter period value
3497  Returns:
3498  None.
3499  Example:
3500  <code>
3501  //Example to use timer for precision time measurement
3502  //without configuring an alarm (interrupt based)
3503  char appState = 0;
3504  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
3505 
3506  switch ( appState )
3507  {
3508  case 0:
3509  //Calculate and set the counter period
3510  DRV_TMR_CounterValue32BitSet ( tmrHandle, ( 0xFFFFFFFF - 0xFF343100 ) );
3511 
3512  //counter starts
3513  DRV_TMR_Start ( tmrHandle );
3514 
3515  //Trigger an application operation against which we want to use the time-out
3516  app_trigger_operation();
3517 
3518  //Check for time-out in the next state
3519  appState++;
3520  case 1:
3521  //Overflows and stops at 0 if no alarm is set
3522  if ( DRV_TMR_CounterValue32BitGet ( tmrHandle ) == 0 )
3523  {
3524  //Time-out
3525  return false;
3526  }
3527  else if ( app_operation_isComplete( ) )
3528  {
3529  //Operation is complete before time-out
3530  return true;
3531  }
3532  </code>
3533  Remarks:
3534  In most of the devices only even numbered instances of timer supports
3535  32-bit mode.
3536  This function will be deprecated later, so avoid using it as much as possible.
3537  Use generic function "DRV_TMR_CounterValueSet" instead of this.
3538 */
3539 #define DRV_TMR_CounterValue32BitSet( handle , counterPeriod ) DRV_TMR_CounterValueSet ( handle , counterPeriod )
3540 // *****************************************************************************
3541 /* Function:
3542  uint16_t DRV_TMR_CounterValue16BitGet ( DRV_HANDLE handle )
3543  Summary:
3544  Reads the 16-bit Timer's counter register.
3545  <p><b>Implementation:</b> Dynamic</p>
3546  Description:
3547  This function returns the 16-bit Timer's value in the counter register. This
3548  is valid only if the 16-bit mode of the timer is selected.
3549  Otherwise use DRV_TMR_CounterValue32BitGet function.
3550  Precondition:
3551  The DRV_TMR_Initialize function must have been called. Must have selected
3552  16-Bit timer mode if mode selection is applicable.
3553  DRV_TMR_Open must have been called to obtain a valid opened device handle.
3554  Parameters:
3555  handle - A valid open-instance handle, returned from the driver's
3556  open routine
3557 
3558  Returns:
3559  Timer period in 16-bit mode.
3560  Example:
3561  <code>
3562  //Example to use timer for precision time measurement
3563  //without configuring an alarm (interrupt based)
3564  char appState = 0;
3565  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
3566 
3567  switch ( appState )
3568  {
3569  case 0:
3570  //Calculate and set the counter period
3571  DRV_TMR_CounterValue16BitSet ( tmrHandle, ( 0xFFFF - 0x1000 ) );
3572 
3573  //counter starts
3574  DRV_TMR_Start ( tmrHandle );
3575 
3576  //Trigger an application operation
3577  app_trigger_operation();
3578 
3579  //Check for time-out in the next state
3580  appState++;
3581  case 1:
3582  //Overflows and stops at 0 if no alarm is set
3583  if ( DRV_TMR_CounterValue16BitGet ( tmrHandle ) == 0 )
3584  {
3585  //Time-out
3586  return false;
3587  }
3588  else if ( app_operation_isComplete( ) )
3589  {
3590  //Operation is complete before time-out
3591  return true;
3592  }
3593  </code>
3594  Remarks:
3595  This function will be deprecated later, so avoid using it as much as possible.
3596  Use generic function "DRV_TMR_CounterValueGet" instead of this.
3597 */
3598 #define DRV_TMR_CounterValue16BitGet( handle ) DRV_TMR_CounterValueGet ( handle )
3599 // *****************************************************************************
3600 /* Function:
3601  uint32_t DRV_TMR_CounterValue32BitGet ( DRV_HANDLE handle )
3602  Summary:
3603  Reads the 32-bit Timer's counter register.
3604  <p><b>Implementation:</b> Dynamic</p>
3605  Description:
3606  This function returns the 32-bit Timer's value in the counter register. This
3607  is valid only if the 32-bit mode of the timer is selected Otherwise use
3608  DRV_TMR_CounterValue16BitGet function.
3609  Precondition:
3610  The DRV_TMR_Initialize function must have been called. Must have selected
3611  32-Bit timer mode.
3612  DRV_TMR_Open must have been called to obtain a valid opened device handle.
3613  Parameters:
3614  handle - A valid open-instance handle, returned from the driver's
3615  open routine
3616 
3617  Returns:
3618  32-Bit Counter value.
3619  Example:
3620  <code>
3621  //Example to use timer for precision time measurement
3622  //without configuring an alarm (interrupt based)
3623  char appState = 0;
3624  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
3625 
3626  switch ( appState )
3627  {
3628  case 0:
3629  //Calculate and set the counter period
3630  DRV_TMR_CounterValue32BitSet ( tmrHandle, ( 0xFFFFFFFF - 0x23321000 ) );
3631 
3632  //counter starts
3633  DRV_TMR_Start ( tmrHandle );
3634 
3635  //Trigger an application operation
3636  app_trigger_operation();
3637 
3638  //Check for time-out in the next state
3639  appState++;
3640  case 1:
3641  //Overflows and stops at 0 if no alarm is set
3642  if ( DRV_TMR_CounterValue32BitGet ( tmrHandle ) == 0 )
3643  {
3644  //Time-out
3645  return false;
3646  }
3647  else if ( app_operation_isComplete( ) )
3648  {
3649  //Operation is complete before time-out
3650  return true;
3651  }
3652  </code>
3653  Remarks:
3654  In most of the devices only even numbered instances of timer supports
3655  32-bit mode.
3656  This function will be deprecated later, so avoid using it as much as possible.
3657  Use generic function "DRV_TMR_CounterValueGet" instead of this.
3658 */
3659 #define DRV_TMR_CounterValue32BitGet( handle ) DRV_TMR_CounterValueGet ( handle )
3660 // *****************************************************************************
3661 /* Function:
3662  void DRV_TMR_Alarm16BitRegister
3663  (
3664  DRV_HANDLE handle,
3665  uint16_t period,
3666  bool isPeriodic,
3667  uintptr_t context,
3668  DRV_TMR_CALLBACK callBack
3669  )
3670  Summary:
3671  Sets up an alarm.
3672  <p><b>Implementation:</b> Dynamic</p>
3673  Description:
3674  This function sets up an alarm, allowing the client to receive a callback
3675  from the driver when the counter period elapses. Alarms can be one-shot or
3676  periodic. This API is valid only if the 16-bit mode of the timer is
3677  selected. Otherwise use DRV_TMR_Alarm32BitRegister function.
3678  Precondition:
3679  The DRV_TMR_Initialize function must have been called. Must have selected
3680  16-Bit timer mode if mode selection is applicable.
3681  DRV_TMR_Open must have been called to obtain a valid opened device handle.
3682  Parameters:
3683  handle - A valid handle, returned from DRV_TMR_Open
3684  period - 16-bit period which will be loaded into the Timer hardware register.
3685 
3686  isPeriodic - Flag indicating whether the alarm should be one-shot or periodic.
3687 
3688  context - A reference, call back function will be called with the same
3689  reference.
3690 
3691  callBack - A call back function which will be called on period elapse.
3692 
3693  Returns:
3694  None
3695  Example:
3696  <code>
3697  //Do the initialization with 'mode' set to DRV_TMR_OPERATION_MODE_16_BIT
3698 
3699  void setupTask ()
3700  {
3701  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
3702 
3703  // Calculate the count to be passed on from the clock input
3704  //Periodically toggle LED
3705  DRV_TMR_Alarm16BitRegister ( tmrHandle, 0xFF40, true, 0,
3706  ToggleLedCallBack );
3707  }
3708 
3709  void ToggleLedCallBack ( uintptr_t context )
3710  {
3711  //Toggle
3712  }
3713  </code>
3714  Remarks:
3715  This function will be deprecated later, so avoid using it as much as possible.
3716  Use generic function "DRV_TMR_AlarmRegister" instead of this.
3717 */
3718 #define DRV_TMR_Alarm16BitRegister( handle , period , isPeriodic , context , callBack ) DRV_TMR_AlarmRegister ( handle , period , isPeriodic , context , callBack )
3719 // *****************************************************************************
3720 /* Function:
3721  void DRV_TMR_Alarm32BitRegister
3722  (
3723  DRV_HANDLE handle,
3724  uint32_t period,
3725  bool isPeriodic,
3726  uintptr_t context,
3727  DRV_TMR_CALLBACK callBack
3728  )
3729  Summary:
3730  Sets up an alarm.
3731  <p><b>Implementation:</b> Dynamic</p>
3732  Description:
3733  This function sets up an alarm, allowing the client to receive a callback
3734  from the driver when the counter period elapses. Alarms can be one-shot or
3735  periodic. This API is valid only if the 32-bit mode of the timer is
3736  selected Otherwise use DRV_TMR_Alarm16BitRegister function.
3737  Precondition:
3738  The DRV_TMR_Initialize function must have been called. Must have selected
3739  32-Bit timer mode.
3740  DRV_TMR_Open must have been called to obtain a valid opened device handle.
3741  Parameters:
3742  handle - A valid handle, returned from DRV_TMR_Open
3743  period - 32-bit period which will be loaded into the Timer hardware register.
3744 
3745  isPeriodic - Flag indicating whether the alarm should be one-shot or periodic.
3746 
3747  context - A reference, call back function will be called with the same
3748  reference.
3749 
3750  callBack - A call back function which will be called on period elapse.
3751 
3752  Returns:
3753  None
3754  Example:
3755  <code>
3756  //Do the initialization with 'mode' set to DRV_TMR_OPERATION_MODE_32_BIT
3757 
3758  void setupTask ()
3759  {
3760  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
3761 
3762  // Calculate the count to be passed on from the clock input
3763  //Periodically toggle LED
3764  DRV_TMR_Alarm32BitRegister ( tmrHandle, 0xFFFFFF00, true, 0,
3765  ToggleLedCallBack );
3766  }
3767 
3768  void ToggleLedCallBack ( uintptr_t context )
3769  {
3770  //Toggle
3771  }
3772  </code>
3773  Remarks:
3774  In most of the devices only even numbered instances of timer supports
3775  32-bit mode.
3776  This function will be deprecated later, so avoid using it as much as possible.
3777  Use generic function "DRV_TMR_AlarmRegister" instead of this.
3778 */
3779 #define DRV_TMR_Alarm32BitRegister( handle , period , isPeriodic , context , callBack ) DRV_TMR_AlarmRegister ( handle , period , isPeriodic , context , callBack )
3780 // *****************************************************************************
3781 /* Function:
3782  void DRV_TMR_AlarmPeriod16BitSet ( DRV_HANDLE handle, uint16_t value )
3783  Summary:
3784  Updates the 16-bit Timer's period.
3785  <p><b>Implementation:</b> Dynamic</p>
3786  Description:
3787  This function updates the 16-bit Timer's period. This API is valid only if
3788  the 16-bit mode of the timer is selected
3789  Otherwise use DRV_TMR_AlarmPeriod32BitSet function.
3790  Precondition:
3791  The DRV_TMR_Initialize function must have been called. Must have selected
3792  16-Bit timer mode if mode selection is applicable.
3793  DRV_TMR_Open must have been called to obtain a valid opened device handle.
3794  Parameters:
3795  handle - A valid open-instance handle, returned from the driver's
3796  open routine
3797  value - 16-bit Period value
3798  Returns:
3799  None.
3800  Example:
3801  <code>
3802  DRV_HANDLE handle; // Returned from DRV_TMR_Open
3803  DRV_TMR_AlarmPeriod16BitSet ( handle, 0x1000 );
3804  </code>
3805  Remarks:
3806  This function will be deprecated later, so avoid using it as much as possible.
3807  Use generic function "DRV_TMR_AlarmPeriodSet" instead of this.
3808 */
3809 #define DRV_TMR_AlarmPeriod16BitSet( handle , value ) DRV_TMR_AlarmPeriodSet ( handle , value )
3810 // *****************************************************************************
3811 /* Function:
3812  void DRV_TMR_AlarmPeriod32BitSet ( DRV_HANDLE handle, uint32_t period )
3813  Summary:
3814  Updates the 32-bit Timer's period.
3815  <p><b>Implementation:</b> Dynamic</p>
3816  Description:
3817  This function updates the 32-bit Timer's period. This API is valid only if
3818  the 32-bit mode of the timer is selected
3819  Otherwise use DRV_TMR_AlarmPeriod16BitSet function.
3820  Precondition:
3821  The DRV_TMR_Initialize unction must have been called. Must have selected
3822  32-Bit timer mode.
3823  DRV_TMR_Open must have been called to obtain a valid opened device handle.
3824  Parameters:
3825  handle - A valid open-instance handle, returned from the driver's
3826  open routine
3827  period - 32-bit Period value
3828  Returns:
3829  None.
3830  Example:
3831  <code>
3832  DRV_HANDLE handle; // Returned from DRV_TMR_Open
3833  DRV_TMR_AlarmPeriod32BitSet ( handle, 0xFFFFFF00 );
3834  </code>
3835  Remarks:
3836  In most of the devices only even numbered instances of timer supports
3837  32-bit mode.
3838  This function will be deprecated later, so avoid using it as much as possible.
3839  Use generic function "DRV_TMR_AlarmPeriodSet" instead of this.
3840 */
3841 #define DRV_TMR_AlarmPeriod32BitSet( handle , period ) DRV_TMR_AlarmPeriodSet ( handle , period )
3842 // *****************************************************************************
3843 /* Function:
3844  uint16_t DRV_TMR_AlarmPeriod16BitGet ( DRV_HANDLE handle )
3845  Summary:
3846  Provides the 16-bit Timer's period.
3847  <p><b>Implementation:</b> Dynamic</p>
3848  Description:
3849  This function gets the 16-bit Timer's period. This API is valid only if
3850  the 16-bit mode of the timer is selected.
3851  Otherwise use DRV_TMR_AlarmPeriod32BitGet function.
3852  Precondition:
3853  The DRV_TMR_Initialize function must have been called. Must have selected
3854  16-Bit timer mode if mode selection is applicable.
3855  DRV_TMR_Open must have been called to obtain a valid opened device handle.
3856  Parameters:
3857  handle - A valid open-instance handle, returned from the driver's
3858  open routine
3859  Returns:
3860  16-bit timer period value
3861  Example:
3862  <code>
3863  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
3864  uint16_t period;
3865 
3866  period = DRV_TMR_AlarmPeriod16BitGet ( tmrHandle );
3867  </code>
3868  Remarks:
3869  This function will be deprecated later, so avoid using it as much as possible.
3870  Use generic function "DRV_TMR_AlarmPeriodGet" instead of this.
3871 */
3872 #define DRV_TMR_AlarmPeriod16BitGet( handle ) DRV_TMR_AlarmPeriodGet ( handle )
3873 // *****************************************************************************
3874 /* Function:
3875  uint32_t DRV_TMR_AlarmPeriod32BitGet ( DRV_HANDLE handle )
3876  Summary:
3877  Provides the 32-bit Timer's period.
3878  <p><b>Implementation:</b> Dynamic</p>
3879  Description:
3880  This function gets the 32-bit Timer's period. This API is valid only if
3881  the 32-bit mode of the timer is selected
3882  Otherwise use DRV_TMR_AlarmPeriod16BitGet function.
3883  Precondition:
3884  The DRV_TMR_Initialize function must have been called. Must have selected
3885  32-Bit timer mode.
3886  DRV_TMR_Open must have been called to obtain a valid opened device handle.
3887  Parameters:
3888  handle - A valid open-instance handle, returned from the driver's
3889  open routine
3890  Returns:
3891  32-bit Timer period value.
3892  Example:
3893  <code>
3894  DRV_HANDLE handle; // Returned from DRV_TMR_Open
3895  uint32_t period;
3896  period = DRV_TMR_AlarmPeriod32BitGet ( handle );
3897  </code>
3898  Remarks:
3899  In most of the devices only even numbered instances of timer supports
3900  32-bit mode.
3901  This function will be deprecated later, so avoid using it as much as possible.
3902  Use generic function "DRV_TMR_AlarmPeriodGet" instead of this.
3903 */
3904 #define DRV_TMR_AlarmPeriod32BitGet( handle ) DRV_TMR_AlarmPeriodGet ( handle )
3905 // *****************************************************************************
3906 /* Function:
3907  void DRV_TMR_Alarm16BitDeregister ( DRV_HANDLE handle )
3908  Summary:
3909  Removes a previously set alarm.
3910  <p><b>Implementation:</b> Dynamic</p>
3911  Description:
3912  This function removes a previously set alarm. This API is valid only if
3913  the 16-bit mode of the timer is selected
3914  Otherwise use DRV_TMR_Alarm32BitDeregister function.
3915  Precondition:
3916  The DRV_TMR_Initialize function must have been called. Must have selected
3917  16-Bit timer mode if mode selection is applicable.
3918  DRV_TMR_Open must have been called to obtain a valid opened device handle.
3919 
3920  DRV_TMR_Alarm16BitRegister function must have been called before.
3921  Parameters:
3922  handle - A valid open-instance handle, returned from the driver's
3923  open routine
3924  Returns:
3925  None.
3926  Example:
3927  <code>
3928  //Example of a key debounce check
3929 
3930  static unsigned int lastReadKey, readKey, keyCount, globalKeyState;
3931  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
3932  //Do the initialization with 'mode' set to DRV_TMR_OPERATION_MODE_16_BIT
3933 
3934  void keyPressDetect ()
3935  {
3936  // Calculate the count to be passed on from the clock input
3937  //Periodically toggle LED
3938  DRV_TMR_Alarm16BitRegister ( tmrHandle, 0xFF00, true,
3939  DebounceCheck );
3940  }
3941 
3942  void DebounceCheck ( uintptr_t context )
3943  {
3944  readKey = AppReadKey();
3945 
3946  if ( readKey != lastReadKey )
3947  {
3948  lastReadKey = readKey;
3949  keyCount = 0;
3950  }
3951  else
3952  {
3953  if ( keyCount > 20 )
3954  {
3955  globalKeyState = readKey;
3956  DRV_TMR_Alarm16BitDeregister ( tmrHandle );
3957  }
3958  keyCount++;
3959  }
3960  }
3961  </code>
3962  Remarks:
3963  This function will be deprecated later, so avoid using it as much as possible.
3964  Use generic function "DRV_TMR_AlarmDeregister" instead of this.
3965 */
3966 #define DRV_TMR_Alarm16BitDeregister( handle ) DRV_TMR_AlarmDeregister ( handle )
3967 // *****************************************************************************
3968 /* Function:
3969  void DRV_TMR_Alarm32BitDeregister ( DRV_HANDLE handle )
3970  Summary:
3971  Removes a previously set alarm.
3972  <p><b>Implementation:</b> Dynamic</p>
3973  Description:
3974  This function removes a previously set alarm. This API is valid only if
3975  the 32-bit mode of the timer is selected
3976  Otherwise use DRV_TMR_Alarm16BitDeregister function.
3977  Precondition:
3978  The DRV_TMR_Initialize function must have been called. Must have selected
3979  32-Bit timer mode if mode selection is applicable.
3980  DRV_TMR_Open must have been called to obtain a valid opened device handle.
3981 
3982  DRV_TMR_Alarm32BitRegister function must have been called before.
3983  Parameters:
3984  handle - A valid open-instance handle, returned from the driver's
3985  open routine
3986  Returns:
3987  None.
3988  Example:
3989  <code>
3990  //Example of a key debounce check
3991 
3992  static unsigned int lastReadKey, readKey, keyCount, globalKeyState;
3993  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
3994  //Do the initialization with 'mode' set to DRV_TMR_OPERATION_MODE_32_BIT
3995 
3996  void keyPressDetect ( void )
3997  {
3998  // Calculate the count to be passed on from the clock input
3999  //Periodically check the key status
4000  DRV_TMR_Alarm32BitRegister ( tmrHandle, 0xFF0FFD20, true, 0,
4001  DebounceCheck );
4002  }
4003 
4004  void DebounceCheck ( uintptr_t context )
4005  {
4006  readKey = AppReadKey();
4007 
4008  if ( readKey != lastReadKey )
4009  {
4010  lastReadKey = readKey;
4011  keyCount = 0;
4012  }
4013  else
4014  {
4015  if ( keyCount > 20 )
4016  {
4017  //Key is stable now
4018  globalKeyState = readKey;
4019  DRV_TMR_Alarm32BitDeregister ( tmrHandle );
4020  }
4021  keyCount++;
4022  }
4023  }
4024  </code>
4025  Remarks:
4026  In most of the devices only even numbered instances of timer supports
4027  32-bit mode.
4028  This function will be deprecated later, so avoid using it as much as possible.
4029  Use generic function "DRV_TMR_AlarmDeregister" instead of this.
4030 */
4031 #define DRV_TMR_Alarm32BitDeregister( handle ) DRV_TMR_AlarmDeregister ( handle )
4032  // #ifndef _DRV_TMR_DEPRECATED_H
4033 /*******************************************************************************
4034  End of File
4035 */
4036 #endif /*00 C:\microchip\harmony\v2_06\framework\driver\tmr\drv_tmr_compatibility.h*/
4037 /* CLOSE_FILE Include File */
4038 
4039 //DOM-IGNORE-BEGIN
4040 //DOM-IGNORE-END
4041  // #ifndef _DRV_TMR_H
4042 /*******************************************************************************
4043  End of File
4044 */
4045 #endif /*00 C:\microchip\harmony\v2_06\framework\driver\tmr\drv_tmr.h*/
4046 /* CLOSE_FILE Include File */
4047 
4048 #include "peripheral/tmr/plib_tmr.h"
4049 #include "peripheral/int/plib_int.h"
4050 // maximum divider value for 32 bit operation mode
4051 #define DRV_TIMER_DIVIDER_MAX_32BIT 0xffffffff
4052 // minimum divider value for 32 bit operation mode
4053 #define DRV_TIMER_DIVIDER_MIN_32BIT 0x2
4054 // maximum divider value for 16 bit operation mode
4055 #define DRV_TIMER_DIVIDER_MAX_16BIT 0x10000
4056 // minimum divider value for 16 bit operation mode
4057 #define DRV_TIMER_DIVIDER_MIN_16BIT 0x2
4058 // *****************************************************************************
4059 // *****************************************************************************
4060 // Section: Interface Headers for Instance 0 for the static driver
4061 // *****************************************************************************
4062 // *****************************************************************************
4063 
4064 void
4065  DRV_TMR0_Initialize ( void ) ;
4066 
4067 bool
4068  DRV_TMR0_Start ( void ) ;
4069 
4070 void
4071  DRV_TMR0_Stop ( void ) ;
4072 
4073 static inline void
4075  {
4076  int izzqqzz=((int)(bitmapstruct.element0 |= (1 << 0))); /* 37 */
4077  DRV_TMR0_Stop () ;
4078  ((int)(bitmapstruct.element0 |= (1 << 1))); /* 30 */
4079  commands_65zqendz ( 2 ) ; /* 30 */
4080  }
4081 
4082 static inline SYS_STATUS
4084 {
4085  int izzqqzz=((int)(bitmapstruct.element0 |= (1 << 2))); /* 37 */
4086  /* Return the status as ready always */
4087  ((int)(bitmapstruct.element0 |= (1 << 3))); /* 30 */
4088  commands_65zqendz ( 4 ) ; /* 30 */
4089  return
4090  SYS_STATUS_READY ;
4091 }
4092 
4093 static inline void
4094  DRV_TMR0_Open ( void )
4095  {
4096  int izzqqzz=((int)(bitmapstruct.element0 |= (1 << 4))); /* 37 */
4097  ((int)(bitmapstruct.element0 |= (1 << 5))); /* 30 */
4098  commands_65zqendz ( 6 ) ; /* 30 */
4099  }
4100 
4102  DRV_TMR0_ClientStatus ( void ) ;
4103 
4104 static inline DRV_TMR_OPERATION_MODE
4106 {
4107  int izzqqzz=((int)(bitmapstruct.element0 |= (1 << 6))); /* 37 */
4108  ((int)(bitmapstruct.element0 |= (1 << 7))); /* 30 */
4109  commands_65zqendz ( 8 ) ; /* 30 */
4110  return
4112 }
4113 
4114 static inline void
4116  {
4117  int izzqqzz=((int)(bitmapstruct.element0 |= (1 << 8))); /* 37 */
4118  DRV_TMR0_Stop () ;
4119  ((int)(bitmapstruct.element0 |= (1 << 9))); /* 30 */
4120  commands_65zqendz ( 10 ) ; /* 30 */
4121  }
4122 
4123 bool
4125  DRV_TMR_CLK_SOURCES clockSource ,
4126  TMR_PRESCALE prescale ) ;
4127 
4128 void
4130  uint32_t value ) ;
4131 
4132 uint32_t
4133  DRV_TMR0_CounterValueGet ( void ) ;
4134 
4135 void
4136  DRV_TMR0_CounterClear ( void ) ;
4137 
4138 TMR_PRESCALE
4139  DRV_TMR0_PrescalerGet ( void ) ;
4140 
4141 void
4143  uint32_t value ) ;
4144 
4145 uint32_t
4146  DRV_TMR0_PeriodValueGet ( void ) ;
4147 
4148 void
4149  DRV_TMR0_StopInIdleDisable ( void ) ;
4150 
4151 void
4152  DRV_TMR0_StopInIdleEnable ( void ) ;
4153 
4154 static inline void
4156  {
4157  int izzqqzz=((int)(bitmapstruct.element0 |= (1 << 10))); /* 37 */
4158  ((int)(bitmapstruct.element0 |= (1 << 11))); /* 30 */
4159  commands_65zqendz ( 12 ) ; /* 30 */
4160  }
4161 
4162 uint32_t
4163  DRV_TMR0_CounterFrequencyGet ( void ) ;
4164 
4167  DRV_TMR_DIVIDER_RANGE * pDivRange ) ;
4168 // *****************************************************************************
4169 // *****************************************************************************
4170 // Section: Interface Headers for Instance 1 for the static driver
4171 // *****************************************************************************
4172 // *****************************************************************************
4173 
4174 void
4175  DRV_TMR1_Initialize ( void ) ;
4176 
4177 bool
4178  DRV_TMR1_Start ( void ) ;
4179 
4180 void
4181  DRV_TMR1_Stop ( void ) ;
4182 
4183 static inline void
4185  {
4186  int izzqqzz=((int)(bitmapstruct.element0 |= (1 << 12))); /* 37 */
4187  DRV_TMR1_Stop () ;
4188  ((int)(bitmapstruct.element0 |= (1 << 13))); /* 30 */
4189  commands_65zqendz ( 14 ) ; /* 30 */
4190  }
4191 
4192 static inline SYS_STATUS
4194 {
4195  int izzqqzz=((int)(bitmapstruct.element0 |= (1 << 14))); /* 37 */
4196  /* Return the status as ready always */
4197  ((int)(bitmapstruct.element0 |= (1 << 15))); /* 30 */
4198  commands_65zqendz ( 16 ) ; /* 30 */
4199  return
4200  SYS_STATUS_READY ;
4201 }
4202 
4203 static inline void
4204  DRV_TMR1_Open ( void )
4205  {
4206  int izzqqzz=((int)(bitmapstruct.element0 |= (1 << 16))); /* 37 */
4207  ((int)(bitmapstruct.element0 |= (1 << 17))); /* 30 */
4208  commands_65zqendz ( 18 ) ; /* 30 */
4209  }
4210 
4212  DRV_TMR1_ClientStatus ( void ) ;
4213 
4214 static inline DRV_TMR_OPERATION_MODE
4216 {
4217  int izzqqzz=((int)(bitmapstruct.element0 |= (1 << 18))); /* 37 */
4218  ((int)(bitmapstruct.element0 |= (1 << 19))); /* 30 */
4219  commands_65zqendz ( 20 ) ; /* 30 */
4220  return
4222 }
4223 
4224 static inline void
4226  {
4227  int izzqqzz=((int)(bitmapstruct.element0 |= (1 << 20))); /* 37 */
4228  DRV_TMR1_Stop () ;
4229  ((int)(bitmapstruct.element0 |= (1 << 21))); /* 30 */
4230  commands_65zqendz ( 22 ) ; /* 30 */
4231  }
4232 
4233 bool
4235  DRV_TMR_CLK_SOURCES clockSource ,
4236  TMR_PRESCALE prescale ) ;
4237 
4238 void
4240  uint32_t value ) ;
4241 
4242 uint32_t
4243  DRV_TMR1_CounterValueGet ( void ) ;
4244 
4245 void
4246  DRV_TMR1_CounterClear ( void ) ;
4247 
4248 TMR_PRESCALE
4249  DRV_TMR1_PrescalerGet ( void ) ;
4250 
4251 void
4253  uint32_t value ) ;
4254 
4255 uint32_t
4256  DRV_TMR1_PeriodValueGet ( void ) ;
4257 
4258 void
4259  DRV_TMR1_StopInIdleDisable ( void ) ;
4260 
4261 void
4262  DRV_TMR1_StopInIdleEnable ( void ) ;
4263 
4264 static inline void
4266  {
4267  int izzqqzz=((int)(bitmapstruct.element0 |= (1 << 22))); /* 37 */
4268  ((int)(bitmapstruct.element0 |= (1 << 23))); /* 30 */
4269  commands_65zqendz ( 24 ) ; /* 30 */
4270  }
4271 
4272 uint32_t
4273  DRV_TMR1_CounterFrequencyGet ( void ) ;
4274 
4277  DRV_TMR_DIVIDER_RANGE * pDivRange ) ;
4278 // *****************************************************************************
4279 // *****************************************************************************
4280 // Section: Interface Headers for Instance 2 for the static driver
4281 // *****************************************************************************
4282 // *****************************************************************************
4283 
4284 void
4285  DRV_TMR2_Initialize ( void ) ;
4286 
4287 bool
4288  DRV_TMR2_Start ( void ) ;
4289 
4290 void
4291  DRV_TMR2_Stop ( void ) ;
4292 
4293 static inline void
4295  {
4296  int izzqqzz=((int)(bitmapstruct.element0 |= (1 << 24))); /* 37 */
4297  DRV_TMR2_Stop () ;
4298  ((int)(bitmapstruct.element0 |= (1 << 25))); /* 30 */
4299  commands_65zqendz ( 26 ) ; /* 30 */
4300  }
4301 
4302 static inline SYS_STATUS
4304 {
4305  int izzqqzz=((int)(bitmapstruct.element0 |= (1 << 26))); /* 37 */
4306  /* Return the status as ready always */
4307  ((int)(bitmapstruct.element0 |= (1 << 27))); /* 30 */
4308  commands_65zqendz ( 28 ) ; /* 30 */
4309  return
4310  SYS_STATUS_READY ;
4311 }
4312 
4313 static inline void
4314  DRV_TMR2_Open ( void )
4315  {
4316  int izzqqzz=((int)(bitmapstruct.element0 |= (1 << 28))); /* 37 */
4317  ((int)(bitmapstruct.element0 |= (1 << 29))); /* 30 */
4318  commands_65zqendz ( 30 ) ; /* 30 */
4319  }
4320 
4322  DRV_TMR2_ClientStatus ( void ) ;
4323 
4324 static inline DRV_TMR_OPERATION_MODE
4326 {
4327  int izzqqzz=((int)(bitmapstruct.element0 |= (1 << 30))); /* 37 */
4328  ((int)(bitmapstruct.element0 |= (1 << 31))); /* 30 */
4329  commands_65zqendz ( 32 ) ; /* 30 */
4330  return
4332 }
4333 
4334 static inline void
4336  {
4337  int izzqqzz=((int)(bitmapstruct.element1 |= (1 << 0))); /* 37 */
4338  DRV_TMR2_Stop () ;
4339  ((int)(bitmapstruct.element1 |= (1 << 1))); /* 30 */
4340  commands_65zqendz ( 34 ) ; /* 30 */
4341  }
4342 
4343 bool
4345  DRV_TMR_CLK_SOURCES clockSource ,
4346  TMR_PRESCALE prescale ) ;
4347 
4348 void
4350  uint32_t value ) ;
4351 
4352 uint32_t
4353  DRV_TMR2_CounterValueGet ( void ) ;
4354 
4355 void
4356  DRV_TMR2_CounterClear ( void ) ;
4357 
4358 TMR_PRESCALE
4359  DRV_TMR2_PrescalerGet ( void ) ;
4360 
4361 void
4363  uint32_t value ) ;
4364 
4365 uint32_t
4366  DRV_TMR2_PeriodValueGet ( void ) ;
4367 
4368 void
4369  DRV_TMR2_StopInIdleDisable ( void ) ;
4370 
4371 void
4372  DRV_TMR2_StopInIdleEnable ( void ) ;
4373 
4374 static inline void
4376  {
4377  int izzqqzz=((int)(bitmapstruct.element1 |= (1 << 2))); /* 37 */
4378  ((int)(bitmapstruct.element1 |= (1 << 3))); /* 30 */
4379  commands_65zqendz ( 36 ) ; /* 30 */
4380  }
4381 
4382 uint32_t
4383  DRV_TMR2_CounterFrequencyGet ( void ) ;
4384 
4387  DRV_TMR_DIVIDER_RANGE * pDivRange ) ;
4388 // *****************************************************************************
4389 // *****************************************************************************
4390 // Section: Interface Headers for Instance 3 for the static driver
4391 // *****************************************************************************
4392 // *****************************************************************************
4393 
4394 void
4395  DRV_TMR3_Initialize ( void ) ;
4396 
4397 bool
4398  DRV_TMR3_Start ( void ) ;
4399 
4400 void
4401  DRV_TMR3_Stop ( void ) ;
4402 
4403 static inline void
4405  {
4406  int izzqqzz=((int)(bitmapstruct.element1 |= (1 << 4))); /* 37 */
4407  DRV_TMR3_Stop () ;
4408  ((int)(bitmapstruct.element1 |= (1 << 5))); /* 30 */
4409  commands_65zqendz ( 38 ) ; /* 30 */
4410  }
4411 
4412 static inline SYS_STATUS
4414 {
4415  int izzqqzz=((int)(bitmapstruct.element1 |= (1 << 6))); /* 37 */
4416  /* Return the status as ready always */
4417  ((int)(bitmapstruct.element1 |= (1 << 7))); /* 30 */
4418  commands_65zqendz ( 40 ) ; /* 30 */
4419  return
4420  SYS_STATUS_READY ;
4421 }
4422 
4423 static inline void
4424  DRV_TMR3_Open ( void )
4425  {
4426  int izzqqzz=((int)(bitmapstruct.element1 |= (1 << 8))); /* 37 */
4427  ((int)(bitmapstruct.element1 |= (1 << 9))); /* 30 */
4428  commands_65zqendz ( 42 ) ; /* 30 */
4429  }
4430 
4432  DRV_TMR3_ClientStatus ( void ) ;
4433 
4434 static inline DRV_TMR_OPERATION_MODE
4436 {
4437  int izzqqzz=((int)(bitmapstruct.element1 |= (1 << 10))); /* 37 */
4438  ((int)(bitmapstruct.element1 |= (1 << 11))); /* 30 */
4439  commands_65zqendz ( 44 ) ; /* 30 */
4440  return
4442 }
4443 
4444 static inline void
4446  {
4447  int izzqqzz=((int)(bitmapstruct.element1 |= (1 << 12))); /* 37 */
4448  DRV_TMR3_Stop () ;
4449  ((int)(bitmapstruct.element1 |= (1 << 13))); /* 30 */
4450  commands_65zqendz ( 46 ) ; /* 30 */
4451  }
4452 
4453 bool
4455  DRV_TMR_CLK_SOURCES clockSource ,
4456  TMR_PRESCALE prescale ) ;
4457 
4458 void
4460  uint32_t value ) ;
4461 
4462 uint32_t
4463  DRV_TMR3_CounterValueGet ( void ) ;
4464 
4465 void
4466  DRV_TMR3_CounterClear ( void ) ;
4467 
4468 TMR_PRESCALE
4469  DRV_TMR3_PrescalerGet ( void ) ;
4470 
4471 void
4473  uint32_t value ) ;
4474 
4475 uint32_t
4476  DRV_TMR3_PeriodValueGet ( void ) ;
4477 
4478 void
4479  DRV_TMR3_StopInIdleDisable ( void ) ;
4480 
4481 void
4482  DRV_TMR3_StopInIdleEnable ( void ) ;
4483 
4484 static inline void
4486  {
4487  int izzqqzz=((int)(bitmapstruct.element1 |= (1 << 14))); /* 37 */
4488  ((int)(bitmapstruct.element1 |= (1 << 15))); /* 30 */
4489  commands_65zqendz ( 48 ) ; /* 30 */
4490  }
4491 
4492 uint32_t
4493  DRV_TMR3_CounterFrequencyGet ( void ) ;
4494 
4497  DRV_TMR_DIVIDER_RANGE * pDivRange ) ;
4498 // *****************************************************************************
4499 // *****************************************************************************
4500 // Section: Interface Headers for Instance 4 for the static driver
4501 // *****************************************************************************
4502 // *****************************************************************************
4503 
4504 void
4505  DRV_TMR4_Initialize ( void ) ;
4506 
4507 bool
4508  DRV_TMR4_Start ( void ) ;
4509 
4510 void
4511  DRV_TMR4_Stop ( void ) ;
4512 
4513 static inline void
4515  {
4516  int izzqqzz=((int)(bitmapstruct.element1 |= (1 << 16))); /* 37 */
4517  DRV_TMR4_Stop () ;
4518  ((int)(bitmapstruct.element1 |= (1 << 17))); /* 30 */
4519  commands_65zqendz ( 50 ) ; /* 30 */
4520  }
4521 
4522 static inline SYS_STATUS
4524 {
4525  int izzqqzz=((int)(bitmapstruct.element1 |= (1 << 18))); /* 37 */
4526  /* Return the status as ready always */
4527  ((int)(bitmapstruct.element1 |= (1 << 19))); /* 30 */
4528  commands_65zqendz ( 52 ) ; /* 30 */
4529  return
4530  SYS_STATUS_READY ;
4531 }
4532 
4533 static inline void
4534  DRV_TMR4_Open ( void )
4535  {
4536  int izzqqzz=((int)(bitmapstruct.element1 |= (1 << 20))); /* 37 */
4537  ((int)(bitmapstruct.element1 |= (1 << 21))); /* 30 */
4538  commands_65zqendz ( 54 ) ; /* 30 */
4539  }
4540 
4542  DRV_TMR4_ClientStatus ( void ) ;
4543 
4544 static inline DRV_TMR_OPERATION_MODE
4546 {
4547  int izzqqzz=((int)(bitmapstruct.element1 |= (1 << 22))); /* 37 */
4548  ((int)(bitmapstruct.element1 |= (1 << 23))); /* 30 */
4549  commands_65zqendz ( 56 ) ; /* 30 */
4550  return
4552 }
4553 
4554 static inline void
4556  {
4557  int izzqqzz=((int)(bitmapstruct.element1 |= (1 << 24))); /* 37 */
4558  DRV_TMR4_Stop () ;
4559  ((int)(bitmapstruct.element1 |= (1 << 25))); /* 30 */
4560  commands_65zqendz ( 58 ) ; /* 30 */
4561  }
4562 
4563 bool
4565  DRV_TMR_CLK_SOURCES clockSource ,
4566  TMR_PRESCALE prescale ) ;
4567 
4568 void
4570  uint32_t value ) ;
4571 
4572 uint32_t
4573  DRV_TMR4_CounterValueGet ( void ) ;
4574 
4575 void
4576  DRV_TMR4_CounterClear ( void ) ;
4577 
4578 TMR_PRESCALE
4579  DRV_TMR4_PrescalerGet ( void ) ;
4580 
4581 void
4583  uint32_t value ) ;
4584 
4585 uint32_t
4586  DRV_TMR4_PeriodValueGet ( void ) ;
4587 
4588 void
4589  DRV_TMR4_StopInIdleDisable ( void ) ;
4590 
4591 void
4592  DRV_TMR4_StopInIdleEnable ( void ) ;
4593 
4594 static inline void
4596  {
4597  int izzqqzz=((int)(bitmapstruct.element1 |= (1 << 26))); /* 37 */
4598  ((int)(bitmapstruct.element1 |= (1 << 27))); /* 30 */
4599  commands_65zqendz ( 60 ) ; /* 30 */
4600  }
4601 
4602 uint32_t
4603  DRV_TMR4_CounterFrequencyGet ( void ) ;
4604 
4607  DRV_TMR_DIVIDER_RANGE * pDivRange ) ;
4608  // #ifndef _DRV_TMR_STATIC_H
4609 /*******************************************************************************
4610  End of File
4611 */
4612 
4613 #endif /*00 C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\framework\driver\tmr\drv_tmr_static.h*/
4614 /* CLOSE_FILE Include File */
4615 
4616 #include "peripheral/int/plib_int.h"
4617 /* OPEN FILE C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\framework\driver\pmp\drv_pmp_static.h */
4618 /*******************************************************************************
4619  PMP Driver Interface Declarations for Static Single Instance Driver
4620  Company:
4621  Microchip Technology Inc.
4622  File Name:
4623  drv_pmp_static.h
4624  Summary:
4625  PMP driver interface declarations for the static single instance driver.
4626  Description:
4627  The PMP device driver provides a simple interface to manage the PMP
4628  modules on Microchip microcontrollers. This file defines the interface
4629  Declarations for the PMP driver.
4630 
4631  Remarks:
4632  Static interfaces incorporate the driver instance number within the names
4633  of the routines, eliminating the need for an object ID or object handle.
4634 
4635  Static single-open interfaces also eliminate the need for the open handle.
4636 *******************************************************************************/
4637 //DOM-IGNORE-BEGIN
4638 /*******************************************************************************
4639 Copyright (c) 2013 released Microchip Technology Inc. All rights reserved.
4640 Microchip licenses to you the right to use, modify, copy and distribute
4641 Software only when embedded on a Microchip microcontroller or digital signal
4642 controller that is integrated into your product or third party product
4643 (pursuant to the sublicense terms in the accompanying license agreement).
4644 You should refer to the license agreement accompanying this Software for
4645 additional information regarding your rights and obligations.
4646 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
4647 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
4648 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
4649 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
4650 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
4651 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
4652 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
4653 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
4654 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
4655 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
4656 *******************************************************************************/
4657 //DOM-IGNORE-END
4658 #ifndef _DRV_PMP_STATIC_H
4659 #define _DRV_PMP_STATIC_H
4660 #include "peripheral/pmp/plib_pmp.h"
4661 // *****************************************************************************
4662 // *****************************************************************************
4663 // Section: Interface Headers for Instance 0 for the static driver
4664 // *****************************************************************************
4665 // *****************************************************************************
4666 
4667 void
4668  DRV_PMP0_Initialize ( void ) ;
4669 
4670 void
4671  DRV_PMP0_ModeConfig ( void ) ;
4672 
4673 void
4675  PMP_DATA_WAIT_STATES dataWait ,
4676  PMP_STROBE_WAIT_STATES strobeWait ,
4677  PMP_DATA_HOLD_STATES dataHold ) ;
4678 
4679 uint8_t
4680  DRV_PMP0_Read ( void ) ;
4681 
4682 void
4683  DRV_PMP0_Write (
4684  uint8_t data ) ;
4685  // #ifndef _DRV_PMP_STATIC_H
4686 /*******************************************************************************
4687  End of File
4688 */
4689 
4690 #endif /*00 C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\framework\driver\pmp\drv_pmp_static.h*/
4691 /* CLOSE_FILE Include File */
4692 
4693 /* OPEN FILE C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\framework\driver\usart\drv_usart_static.h */
4694 /*******************************************************************************
4695  USART Driver Interface Declarations for Static Single Instance Driver
4696  Company:
4697  Microchip Technology Inc.
4698  File Name:
4699  drv_usart_static.h
4700  Summary:
4701  USART driver interface declarations for the static single instance driver.
4702  Description:
4703  The USART device driver provides a simple interface to manage the USART
4704  modules on Microchip microcontrollers. This file defines the interface
4705  Declarations for the USART static driver.
4706  Remarks:
4707  Static interfaces incorporate the driver instance number within the names
4708  of the routines, eliminating the need for an object ID or object handle.
4709  Static single-open interfaces also eliminate the need for the open handle.
4710 *******************************************************************************/
4711 //DOM-IGNORE-BEGIN
4712 /*******************************************************************************
4713 Copyright (c) 2015 released Microchip Technology Inc. All rights reserved.
4714 Microchip licenses to you the right to use, modify, copy and distribute
4715 Software only when embedded on a Microchip microcontroller or digital signal
4716 controller that is integrated into your product or third party product
4717 (pursuant to the sublicense terms in the accompanying license agreement).
4718 You should refer to the license agreement accompanying this Software for
4719 additional information regarding your rights and obligations.
4720 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
4721 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
4722 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
4723 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
4724 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
4725 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
4726 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
4727 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
4728 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
4729 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
4730 *******************************************************************************/
4731 //DOM-IGNORE-END
4732 #ifndef _DRV_USART_STATIC_H
4733 #define _DRV_USART_STATIC_H
4734 // *****************************************************************************
4735 // *****************************************************************************
4736 // Section: Included Files
4737 // *****************************************************************************
4738 // *****************************************************************************
4739 /* OPEN FILE C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\framework\driver\usart\src\drv_usart_static_local.h */
4740 /*******************************************************************************
4741  USART Driver Local Data Structures for static implementation
4742  Company:
4743  Microchip Technology Inc.
4744  File Name:
4745  drv_usart_static_local.h
4746  Summary:
4747  USART Driver Local Data Structures for static implementation
4748  Description:
4749  Driver Local Data Structures for static implementation
4750 *******************************************************************************/
4751 //DOM-IGNORE-BEGIN
4752 /*******************************************************************************
4753 Copyright (c) 2015 released Microchip Technology Inc. All rights reserved.
4754 Microchip licenses to you the right to use, modify, copy and distribute Software
4755 only when embedded on a Microchip microcontroller or digital signal controller
4756 that is integrated into your product or third party product (pursuant to the
4757 sublicense terms in the accompanying license agreement).
4758 You should refer to the license agreement accompanying this Software for
4759 additional information regarding your rights and obligations.
4760 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
4761 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
4762 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
4763 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
4764 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
4765 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
4766 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
4767 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
4768 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
4769 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
4770 *******************************************************************************/
4771 //DOM-IGNORE-END
4772 #ifndef _DRV_USART_STATIC_LOCAL_H
4773 #define _DRV_USART_STATIC_LOCAL_H
4774 // *****************************************************************************
4775 // *****************************************************************************
4776 // Section: Included Files
4777 // *****************************************************************************
4778 // *****************************************************************************
4779 #include <stdint.h>
4780 #include <stdbool.h>
4781 #include <stddef.h>
4782 /* OPEN FILE C:\microchip\harmony\v2_06\framework\driver\usart\drv_usart.h */
4783 /*******************************************************************************
4784  USART Driver Interface Header File
4785  Company:
4786  Microchip Technology Inc.
4787  File Name:
4788  drv_usart.h
4789  Summary:
4790  USART Driver Interface Header File
4791  Description:
4792  The USART device driver provides a simple interface to manage the USART or
4793  UART modules on Microchip microcontrollers. This file provides the
4794  interface definition for the USART driver.
4795 *******************************************************************************/
4796 //DOM-IGNORE-BEGIN
4797 /*******************************************************************************
4798 Copyright (c) 2012-2014 released Microchip Technology Inc. All rights reserved.
4799 Microchip licenses to you the right to use, modify, copy and distribute
4800 Software only when embedded on a Microchip microcontroller or digital signal
4801 controller that is integrated into your product or third party product
4802 (pursuant to the sublicense terms in the accompanying license agreement).
4803 You should refer to the license agreement accompanying this Software for
4804 additional information regarding your rights and obligations.
4805 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
4806 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
4807 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
4808 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
4809 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
4810 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
4811 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
4812 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
4813 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
4814 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
4815 *******************************************************************************/
4816 //DOM-IGNORE-END
4817 #ifndef _DRV_USART_H
4818 #define _DRV_USART_H
4819 // *****************************************************************************
4820 // *****************************************************************************
4821 // Section: File includes
4822 // *****************************************************************************
4823 // *****************************************************************************
4824 /* OPEN FILE C:\microchip\harmony\v2_06\framework\driver\usart\drv_usart_definitions.h */
4825 /*******************************************************************************
4826  USART Driver Definitions Header File
4827  Company:
4828  Microchip Technology Inc.
4829  File Name:
4830  drv_usart_definitions.h
4831  Summary:
4832  USART Driver Definitions Header File
4833  Description:
4834  This file will provide enumerations and other dependencies needed by
4835  USART driver to manage the USART/UART module on PIC32 microcontrollers.
4836 *******************************************************************************/
4837 //DOM-IGNORE-BEGIN
4838 /*******************************************************************************
4839 Copyright (c) 2012-2014 released Microchip Technology Inc. All rights reserved.
4840 Microchip licenses to you the right to use, modify, copy and distribute
4841 Software only when embedded on a Microchip microcontroller or digital signal
4842 controller that is integrated into your product or third party product
4843 (pursuant to the sublicense terms in the accompanying license agreement).
4844 You should refer to the license agreement accompanying this Software for
4845 additional information regarding your rights and obligations.
4846 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
4847 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
4848 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
4849 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
4850 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
4851 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
4852 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
4853 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
4854 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
4855 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
4856 *******************************************************************************/
4857 //DOM-IGNORE-END
4858 #ifndef _DRV_USART_DEFINITIONS_H
4859 #define _DRV_USART_DEFINITIONS_H
4860 // *****************************************************************************
4861 // *****************************************************************************
4862 // Section: File includes
4863 // *****************************************************************************
4864 // *****************************************************************************
4865 #include "C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\system_config.h" /* LDRA full path */
4866 #include "C:\microchip\harmony\v2_06\framework\driver\driver_common.h" /* LDRA full path */
4867 /* OPEN FILE C:\microchip\harmony\v2_06\framework\peripheral\usart\plib_usart.h */
4868 /*******************************************************************************
4869  USART Peripheral Library Interface Header
4870  Company:
4871  Microchip Technology Inc.
4872  File Name:
4873  plib_usart.h
4874  Summary:
4875  USART Peripheral Library interface header.
4876  Description:
4877  This header file contains the function prototypes and definitions of
4878  the data types and constants that make up the interface to the USART
4879  Peripheral Library for all families of Microchip microcontrollers. The
4880  functions in this file are common to the USART module.
4881  *******************************************************************************/
4882 // DOM-IGNORE-BEGIN
4883 /*******************************************************************************
4884 Copyright 2010-2015 released Microchip Technology Inc. All rights reserved.
4885 Microchip licenses to you the right to use, modify, copy and distribute
4886 Software only when embedded on a Microchip microcontroller or digital signal
4887 controller that is integrated into your product or third party product
4888 (pursuant to the sublicense terms in the accompanying license agreement).
4889 You should refer to the license agreement accompanying this Software for
4890 additional information regarding your rights and obligations.
4891 SOFTWARE AND DOCUMENTATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND,
4892 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
4893 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
4894 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
4895 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
4896 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
4897 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
4898 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
4899 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
4900 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
4901  *******************************************************************************/
4902 // DOM-IGNORE-END
4903 #ifndef _PLIB_USART_H
4904 #define _PLIB_USART_H
4905 // DOM-IGNORE-BEGIN
4906 // DOM-IGNORE-END
4907 // ****************************************************************************
4908 // ****************************************************************************
4909 // Section: Included Files
4910 // ****************************************************************************
4911 // ****************************************************************************
4912 /* This section lists the other files that are included in this file.
4913 */
4914 /* OPEN FILE C:\microchip\harmony\v2_06\framework\peripheral\usart\processor\usart_processor.h */
4915 /*******************************************************************************
4916  Processor Selector File for the USART
4917  Company:
4918  Microchip Technology Incorporated
4919  File Name:
4920  processor.h
4921  Summary:
4922  Selects the appropriate header for the part family
4923  Description:
4924  This file selects the appropriate header for the part family
4925  *******************************************************************************/
4926 // DOM-IGNORE-BEGIN
4927 /*******************************************************************************
4928 Copyright (c) 2012 released Microchip Technology Inc. All rights reserved.
4929 Microchip licenses to you the right to use, modify, copy and distribute
4930 Software only when embedded on a Microchip microcontroller or digital signal
4931 controller that is integrated into your product or third party product
4932 (pursuant to the sublicense terms in the accompanying license agreement).
4933 You should refer to the license agreement accompanying this Software for
4934 additional information regarding your rights and obligations.
4935 SOFTWARE AND DOCUMENTATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND,
4936 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
4937 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
4938 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
4939 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
4940 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
4941 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
4942 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
4943 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
4944 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
4945  *******************************************************************************/
4946 // DOM-IGNORE-END
4947 #ifndef _USART_PROCESSOR_H
4948 #define _USART_PROCESSOR_H
4949 // *****************************************************************************
4950 // *****************************************************************************
4951 // Section: Included Files
4952 // *****************************************************************************
4953 // *****************************************************************************
4954 /* This section lists the other files that are included in this file.
4955  */
4956 #include <stdint.h>
4957 #include <stdbool.h>
4958 #error "No Processor Family specified"
4959  //
4960  // _USART_PROCESSOR_H
4961 /*******************************************************************************
4962  End of File
4963  */
4964 #endif /*00 C:\microchip\harmony\v2_06\framework\peripheral\usart\processor\usart_processor.h*/
4965 /* CLOSE_FILE Include File */
4966 
4967 // ****************************************************************************
4968 // ****************************************************************************
4969 // Section: USART Peripheral Library Interface Functions
4970 // ****************************************************************************
4971 // ****************************************************************************
4972 //******************************************************************************
4973 /* Function:
4974  void PLIB_USART_RunInOverflowEnable ( USART_MODULE_ID index )
4975  Summary:
4976  Enables the USART module to continue to operate when an overflow error
4977  condition has occurred.
4978  Description:
4979  This function enables the USART module to continue to operate when an
4980  overflow error condition has occurred.
4981  This operation is atomic.
4982  Precondition:
4983  None.
4984  Parameters:
4985  index - Identifier for the device instance to be configured
4986  Returns:
4987  None.
4988  Example:
4989  <code>
4990 #define MY_USART_INSTANCE USART_ID_1
4991  PLIB_USART_RunInOverflowEnable (MY_USART_INSTANCE);
4992  </code>
4993  Remarks:
4994  This feature may not be available on all devices. Please refer to the
4995  specific device data sheet to determine availability or use
4996  PLIB_USART_ExistsRunInOverflow in your application to determine
4997  whether this feature is available.
4998 */
4999 
5000 void
5002  USART_MODULE_ID index ) ;
5003 //******************************************************************************
5004 /* Function:
5005  void PLIB_USART_RunInOverflowDisable ( USART_MODULE_ID index )
5006  Summary:
5007  Disables the Run in overflow condition mode.
5008  Description:
5009  This function disables the USART module from accepting new data when an overflow
5010  error condition is detected.
5011  This operation is atomic.
5012  Precondition:
5013  None.
5014  Parameters:
5015  index - Identifier for the device instance to be configured
5016  Returns:
5017  None.
5018  Example:
5019  <code>
5020 #define MY_USART_INSTANCE USART_ID_1
5021  PLIB_USART_RunInOverflowDisable (MY_USART_INSTANCE);
5022  </code>
5023  Remarks:
5024  This feature may not be available on all devices. Please refer to the
5025  specific device data sheet to determine availability or use
5026  PLIB_USART_ExistsRunInOverflow in your application to determine
5027  whether this feature is available.
5028 */
5029 
5030 void
5032  USART_MODULE_ID index ) ;
5033 //******************************************************************************
5034 /* Function:
5035  bool PLIB_USART_RunInOverflowIsEnabled ( USART_MODULE_ID index )
5036  Summary:
5037  Gets the status of the Run in Overflow condition.
5038  Description:
5039  This function indicates if the USART module has been enabled to run in
5040  an overflow condition.
5041  This operation is atomic.
5042  Precondition:
5043  None.
5044  Parameters:
5045  index - Identifier for the device instance
5046  Returns:
5047  - true - Run in overflow condition is enabled
5048  - false - Run in overflow condition is disabled
5049  Example:
5050  <code>
5051 #define MY_USART_INSTANCE USART_ID_1
5052  bool status;
5053  status = PLIB_USART_RunInOverflowIsEnabled (MY_USART_INSTANCE);
5054  </code>
5055  Remarks:
5056  This feature may not be available on all devices. Please refer to the
5057  specific device data sheet to determine availability or use
5058  PLIB_USART_ExistsRunInOverflow in your application to determine
5059  whether this feature is available.
5060 */
5061 
5062 bool
5064  USART_MODULE_ID index ) ;
5065 //******************************************************************************
5066 /* Function:
5067  void PLIB_USART_BRGClockSourceSelect
5068  (
5069  USART_MODULE_ID index,
5070  USART_BRG_CLOCK_SOURCE brgClockSource
5071  )
5072  Summary:
5073  Configures the BRG clock source of the USART module.
5074  Description:
5075  This function configures the BRG Clock source of the USART. Refer to
5076  USART_BRG_CLOCK_SOURCE for the possible clock sources.
5077  Precondition:
5078  None.
5079  Parameters:
5080  index - Identifier for the device instance to be configured
5081  brgClockSource - One of the possible values from USART_BRG_CLOCK_SOURCE
5082  Returns:
5083  None.
5084  Example:
5085  <code>
5086 #define MY_USART_INSTANCE USART_ID_1
5087  PLIB_USART_BRGClockSourceSelect (MY_USART_INSTANCE, USART_BRG_CLOCK_SOURCE_FRC_IN_SLEEP);
5088  </code>
5089  Remarks:
5090  This feature may not be available on all devices. Please refer to the
5091  specific device data sheet to determine availability or use
5092  PLIB_USART_ExistsBRGClockSourceSelect in your application to determine
5093  whether this feature is available.
5094 */
5095 
5096 void
5098  USART_MODULE_ID index ,
5099  USART_BRG_CLOCK_SOURCE brgClockSource ) ;
5100 //******************************************************************************
5101 /* Function:
5102  USART_BRG_CLOCK_SOURCE PLIB_USART_BRGClockSourceGet ( USART_MODULE_ID index )
5103  Summary:
5104  Gets the BRG clock source of the USART module.
5105  Description:
5106  This function returns the BRG Clock source of the USART. Refer to
5107  USART_BRG_CLOCK_SOURCE for the possible clock sources.
5108  This operation is atomic.
5109  Precondition:
5110  None.
5111  Parameters:
5112  index - Identifier for the device instance
5113  Returns:
5114  One of the possible values of USART_BRG_CLOCK_SOURCE
5115  Example:
5116  <code>
5117 #define MY_USART_INSTANCE USART_ID_1
5118  USART_BRG_CLOCK_SOURCE brgClockSource;
5119  brgClockSource = PLIB_USART_BRGClockSourceGet (MY_USART_INSTANCE);
5120  </code>
5121  Remarks:
5122  This feature may not be available on all devices. Please refer to the
5123  specific device data sheet to determine availability or use
5124  PLIB_USART_ExistsBRGClockSourceSelect in your application to determine
5125  whether this feature is available.
5126 */
5127 
5128 USART_BRG_CLOCK_SOURCE
5130  USART_MODULE_ID index ) ;
5131 //******************************************************************************
5132 /* Function:
5133  bool PLIB_USART_ModuleIsBusy ( USART_MODULE_ID index )
5134  Summary:
5135  Returns the USART module's running status.
5136  Description:
5137  This function checks if the USART module status is busy. The following
5138  functions should not be used when the module status is busy:
5139  - PLIB_USART_LineControlModeSelect
5140  - PLIB_USART_BaudRateHighSet
5141  - PLIB_USART_BaudRateHighEnable
5142  - PLIB_USART_BaudRateHighDisable
5143  - PLIB_USART_ReceiverIdleStateLowEnable
5144  - PLIB_USART_ReceiverIdleStateLowDisable
5145  - PLIB_USART_BaudRateAutoDetectEnable
5146  - PLIB_USART_LoopbackEnable
5147  - PLIB_USART_LoopbackDisable
5148  - PLIB_USART_WakeOnStartEnable
5149  - PLIB_USART_WakeOnStartDisable
5150  - PLIB_USART_OperationModeSelect
5151  - PLIB_USART_HandshakeModeSelect
5152  - PLIB_USART_IrDAEnable
5153  - PLIB_USART_IrDADisable
5154  - PLIB_USART_StopInIdleEnable
5155  - PLIB_USART_StopInIdleDisable
5156  - PLIB_USART_RunInOverflowEnable
5157  - PLIB_USART_RunInOverflowDisable
5158  - PLIB_USART_BRGClockSourceSelect
5159  - PLIB_USART_RunInSleepModeEnable
5160  - PLIB_USART_RunInSleepModeDisable
5161  This operation is atomic.
5162  Precondition:
5163  None.
5164  Parameters:
5165  index - Identifier for the device instance
5166  Returns:
5167  - true - USART module is busy
5168  - false - USART module is idle
5169  Example:
5170  <code>
5171 #define MY_USART_INSTANCE USART_ID_1
5172  bool moduleStatus;
5173  moduleStatus = PLIB_USART_ModuleIsBusy (MY_USART_INSTANCE);
5174  </code>
5175  Remarks:
5176  This feature may not be available on all devices. Please refer to the
5177  specific device data sheet to determine availability or use
5178  PLIB_USART_ExistsModuleBusyStatus in your application to determine
5179  whether this feature is available.
5180 */
5181 
5182 bool
5184  USART_MODULE_ID index ) ;
5185 //******************************************************************************
5186 /* Function:
5187  void PLIB_USART_RunInSleepModeEnable ( USART_MODULE_ID index )
5188  Summary:
5189  Allows the USART module's BRG clock to run when the device enters Sleep mode.
5190  Description:
5191  This function enables the USART module's BRG clock to continue operation when
5192  the device enters the Sleep mode.
5193  This operation is atomic.
5194  Precondition:
5195  None.
5196  Parameters:
5197  index - Identifier for the device instance to be configured
5198  Returns:
5199  None.
5200  Example:
5201  <code>
5202 #define MY_USART_INSTANCE USART_ID_1
5203  PLIB_USART_RunInSleepModeEnable (MY_USART_INSTANCE);
5204  </code>
5205  Remarks:
5206  This feature may not be available on all devices. Please refer to the
5207  specific device data sheet to determine availability or use
5208  PLIB_USART_ExistsRunInSleepMode in your application to determine
5209  whether this feature is available.
5210 */
5211 
5212 void
5214  USART_MODULE_ID index ) ;
5215 //******************************************************************************
5216 /* Function:
5217  void PLIB_USART_RunInSleepModeDisable ( USART_MODULE_ID index )
5218  Summary:
5219  Turns off the USART module's BRG clock during Sleep mode.
5220  Description:
5221  This function turns off the USART module's BRG clock during Sleep mode.
5222  This operation is atomic.
5223  Precondition:
5224  None.
5225  Parameters:
5226  index - Identifier for the device instance to be configured
5227  Returns:
5228  None.
5229  Example:
5230  <code>
5231 #define MY_USART_INSTANCE USART_ID_1
5232  PLIB_USART_RunInSleepModeDisable (MY_USART_INSTANCE);
5233  </code>
5234  Remarks:
5235  This feature may not be available on all devices. Please refer to the
5236  specific device data sheet to determine availability or use
5237  PLIB_USART_ExistsRunInSleepMode in your application to determine
5238  whether this feature is available.
5239 */
5240 
5241 void
5243  USART_MODULE_ID index ) ;
5244 //******************************************************************************
5245 /* Function:
5246  bool PLIB_USART_RunInSleepModeIsEnabled ( USART_MODULE_ID index )
5247  Summary:
5248  Gets the status of Run in Sleep mode.
5249  Description:
5250  This function indicates if the USART module has been enabled to run in
5251  Sleep mode.
5252  This operation is atomic.
5253  Precondition:
5254  None.
5255  Parameters:
5256  index - Identifier for the device instance
5257  Returns:
5258  - true - Run in Sleep mode is enabled
5259  - false - Run in Sleep mode is disabled
5260  Example:
5261  <code>
5262 #define MY_USART_INSTANCE USART_ID_1
5263  bool status;
5264  status = PLIB_USART_RunInSleepModeIsEnabled (MY_USART_INSTANCE);
5265  </code>
5266  Remarks:
5267  This feature may not be available on all devices. Please refer to the
5268  specific device data sheet to determine availability or use
5269  PLIB_USART_ExistsRunInSleepMode in your application to determine
5270  whether this feature is available.
5271 */
5272 
5273 bool
5275  USART_MODULE_ID index ) ;
5276 //******************************************************************************
5277 /* Function:
5278  void PLIB_USART_Enable ( USART_MODULE_ID index )
5279  Summary:
5280  Enables the specific USART module.
5281  Description:
5282  This function enables the specific USART module.
5283  This operation is atomic.
5284  Precondition:
5285  None.
5286  Parameters:
5287  index - Identifier for the device instance to be configured
5288  Returns:
5289  None.
5290  Example:
5291  <code>
5292 #define MY_USART_INSTANCE USART_ID_1
5293  PLIB_USART_Enable(MY_USART_INSTANCE);
5294  </code>
5295  Remarks:
5296  By calling this function, the USART pins are controlled by the USART
5297  module.
5298  This feature may not be available on all devices. Please refer to the
5299  specific device data sheet to determine availability or use
5300  PLIB_USART_ExistsEnable in your application to determine whether
5301  this feature is available.
5302 */
5303 
5304 void
5306  USART_MODULE_ID index ) ;
5307 //******************************************************************************
5308 /* Function:
5309  void PLIB_USART_Disable ( USART_MODULE_ID index )
5310  Summary:
5311  Disables the specific USART module
5312  Description:
5313  This function disables the specific USART module.
5314  This operation is atomic.
5315  Precondition:
5316  None.
5317  Parameters:
5318  index - Identifier for the device instance to be configured
5319  Returns:
5320  None.
5321  Example:
5322  <code>
5323 #define MY_USART_INSTANCE USART_ID_1
5324  PLIB_USART_Disable(MY_USART_INSTANCE);
5325  </code>
5326  Remarks:
5327  The default state after any reset for a USART module is the disable state.
5328  If the USART is disabled, all of the related pins are in control of the
5329  general purpose I/O logic.
5330 
5331  Disabling the USART module resets the buffers to empty states. Any data
5332  characters in the buffers are lost and the baud rate is reset. All error
5333  and status bits are also reset.
5334 
5335  Disabling the USART while the USART is active, will abort all pending
5336  transmissions and receptions. Re-enabling the USART will restart the
5337  module in the same configuration.
5338 
5339  When disabled, the USART power consumption is minimal.
5340  This feature may not be available on all devices. Please refer to the
5341  specific device data sheet to determine availability or use
5342  PLIB_USART_ExistsEnable in your application to determine whether
5343  this feature is available.
5344 */
5345 
5346 void
5348  USART_MODULE_ID index ) ;
5349 //******************************************************************************
5350 /* Function:
5351  void PLIB_USART_TransmitterEnable ( USART_MODULE_ID index )
5352  Summary:
5353  Enables the specific USART module transmitter.
5354  Description:
5355  This function enables the specific USART module transmitter.
5356  This operation is atomic.
5357  Precondition:
5358  The USART module should be enabled using the function PLIB_USART_Enable
5359  before this function is called.
5360  Parameters:
5361  index - Identifier for the device instance to be configured
5362  Returns:
5363  None.
5364  Example:
5365  <code>
5366 #define MY_USART_INSTANCE USART_ID_1
5367  PLIB_USART_TransmitterEnable(MY_USART_INSTANCE);
5368  </code>
5369  Remarks:
5370  The transmitter should not be enabled until the USART is enabled.
5371  The transmissions will not be enabled otherwise.
5372 
5373  This feature may not be available on all devices. Please refer to the
5374  specific device data sheet to determine availability or use
5375  PLIB_USART_ExistsTransmitterEnable in your application to determine whether
5376  this feature is available.
5377 */
5378 
5379 void
5381  USART_MODULE_ID index ) ;
5382 //******************************************************************************
5383 /* Function:
5384  void PLIB_USART_TransmitterDisable ( USART_MODULE_ID index )
5385  Summary:
5386  Disables the specific USART module transmitter.
5387  Description:
5388  This function disables the specific USART module transmitter.
5389  This operation is atomic.
5390  Precondition:
5391  None.
5392  Parameters:
5393  index - Identifier for the device instance to be configured
5394  Returns:
5395  None.
5396  Example:
5397  <code>
5398 #define MY_USART_INSTANCE USART_ID_1
5399  PLIB_USART_TransmitterDisable(MY_USART_INSTANCE);
5400  </code>
5401  Remarks:
5402  Disabling the transmitter during a transmission will cause the
5403  transmission to be aborted.
5404 
5405  This feature may not be available on all devices. Please refer to the
5406  specific device data sheet to determine availability or use
5407  PLIB_USART_ExistsTransmitterEnable in your application to determine whether
5408  this feature is available.
5409 */
5410 
5411 void
5413  USART_MODULE_ID index ) ;
5414 //******************************************************************************
5415 /* Function:
5416  void PLIB_USART_BaudRateSet ( USART_MODULE_ID index, uint32_t clockFrequency,
5417  uint32_t baudRate );
5418  Summary:
5419  Sets the baud rate to the desired value.
5420  Description:
5421  This function sets the baud rate to the desired value.
5422  Precondition:
5423  None.
5424  Parameters:
5425  index - Identifier for the device instance to be configured
5426  baudRate - Baud Rate Value
5427  clockFrequency - Clock Frequency
5428  Returns:
5429  None.
5430  Example:
5431  <code>
5432 #define MY_USART_INSTANCE USART_ID_1
5433  uint32_t baudRateValue ;
5434  PLIB_USART_BaudRateSet(MY_USART_INSTANCE, MY_CLOCK_FREQUENCY, 9600);
5435  baudRateValue = PLIB_USART_BaudRateGet(MY_USART_INSTANCE, MY_CLOCK_FREQUENCY);
5436  </code>
5437  Remarks:
5438  Setting a new baud rate value causes the baud rate timer to reset.
5439  This ensures that the baud rate timer does not have to overflow before
5440  outputting the new baud rate.
5441 
5442  If the system clock is changed during an active receive operation, a
5443  receiver error or data loss may result. To avoid this issue verify that
5444  no receptions are in progress before changing the system clock.
5445 
5446  This feature may not be available on all devices. Please refer to the
5447  specific device data sheet to determine availability or use
5448  PLIB_USART_ExistsBaudRate in your application to determine whether
5449  this feature is available.
5450 */
5451 
5452 void
5454  USART_MODULE_ID index ,
5455  uint32_t clockFrequency ,
5456  uint32_t baudRate ) ;
5457 //******************************************************************************
5458 /* Function:
5459  void PLIB_USART_BaudRateHighSet ( USART_MODULE_ID index,
5460  uint32_t clockFrequency, uint32_t baudRate );
5461  Summary:
5462  Sets the baud rate to the desired value.
5463  Description:
5464  This function sets the baud rate to the desired value.
5465  Precondition:
5466  None.
5467  Parameters:
5468  index - Identifier for the device instance to be configured
5469  baudRate - Baud Rate Value, it is the baud rate value
5470  clockFrequency - Clock Frequency
5471  Returns:
5472  None.
5473  Example:
5474  <code>
5475 #define MY_USART_INSTANCE USART_ID_1
5476  uint32_t baudRateValue ;
5477  PLIB_USART_BaudRateHighSet(MY_USART_INSTANCE, MY_CLOCK_FREQUENCY, 9600);
5478  baudRateValue = PLIB_USART_BaudRateGet(MY_USART_INSTANCE, MY_CLOCK_FREQUENCY);
5479  </code>
5480  Remarks:
5481  Setting a new baud rate value causes the baud rate timer to reset.
5482  This ensures that the baud rate timer does not have to overflow before
5483  outputting the new baud rate.
5484 
5485  If the system clock is changed during an active receive operation, a
5486  receiver error or data loss may result. To avoid this issue verify that
5487  no receptions are in progress before changing the system clock.
5488 
5489  This feature may not be available on all devices. Please refer to the
5490  specific device data sheet to determine availability or use
5491  PLIB_USART_ExistsBaudRateHigh in your application to determine whether
5492  this feature is available.
5493 */
5494 
5495 void
5497  USART_MODULE_ID index ,
5498  uint32_t clockFrequency ,
5499  uint32_t baudRate ) ;
5500 //******************************************************************************
5501 /* Function:
5502  uint32_t PLIB_USART_BaudRateGet ( USART_MODULE_ID index,
5503  int32_t clockFrequency );
5504  Summary:
5505  Gets the baud rate current in use.
5506  Description:
5507  This function gets the baud rate that is currently in use. The clock frequency
5508  needs to be passed to the function.
5509  Conditions:
5510  None.
5511  Input:
5512  index - Identifier for the device instance to be configured
5513  clockFrequency - Clock Frequency
5514  Returns:
5515  - BaudRate - Baud rate value
5516  Example:
5517  <code>
5518 #define MY_USART_INSTANCE USART_ID_1
5519  uint32_t baudRate ;
5520  PLIB_USART_BaudRateSet(MY_USART_INSTANCE, MY_CLOCK_FREQUENCY, 9600);
5521  baudRate = PLIB_USART_BaudRateGet(MY_USART_INSTANCE, MY_CLOCK_FREQUENCY);
5522  </code>
5523  Remarks:
5524  This feature may not be available on all devices. Please refer to the
5525  specific device data sheet to determine availability or use
5526  PLIB_USART_ExistsBaudRate in your application to determine whether
5527  this feature is available.
5528 */
5529 
5530 uint32_t
5532  USART_MODULE_ID index ,
5533  int32_t clockFrequency ) ;
5534 //******************************************************************************
5535 /* Function:
5536  void PLIB_USART_AddressSet
5537  (
5538  USART_MODULE_ID index,
5539  uint8_t address
5540  )
5541  Summary:
5542  Sets the address for the Address Detect mode.
5543  Description:
5544  This function sets the address for the Address Detect mode.
5545  This operation is atomic.
5546  Precondition:
5547  None.
5548  Parameters:
5549  index - Identifier for the device instance to be configured
5550  address - Address
5551  Returns:
5552  None.
5553  Example:
5554  <code>
5555 #define MY_USART_INSTANCE USART_ID_1
5556  uint8_t address = 0x02;
5557  PLIB_USART_AddressSet (MY_USART_INSTANCE, address);
5558  </code>
5559  Remarks:
5560  This feature may not be available on all devices. Please refer to the
5561  specific device data sheet to determine availability or use
5562  PLIB_USART_ExistsReceiverAddress in your application to determine
5563  whether this feature is available.
5564 */
5565 
5566 void
5568  USART_MODULE_ID index ,
5569  uint8_t address ) ;
5570 //******************************************************************************
5571 /* Function:
5572  uint8_t PLIB_USART_AddressGet
5573  (
5574  USART_MODULE_ID index
5575  )
5576  Summary:
5577  Gets the address for the Address Detect mode.
5578  Description:
5579  This function returns the address value being used for the Address
5580  Detect mode.
5581  This operation is atomic.
5582  Precondition:
5583  None.
5584  Parameters:
5585  index - Identifier for the device instance
5586  Returns:
5587  - address - The address being used
5588  Example:
5589  <code>
5590 #define MY_USART_INSTANCE USART_ID_1
5591  uint8_t address = 0;
5592  address = PLIB_USART_AddressGet (MY_USART_INSTANCE);
5593  </code>
5594  Remarks:
5595  This feature may not be available on all devices. Please refer to the
5596  specific device data sheet to determine availability or use
5597  PLIB_USART_ExistsReceiverAddress in your application to determine
5598  whether this feature is available.
5599 */
5600 
5601 uint8_t
5603  USART_MODULE_ID index ) ;
5604 //******************************************************************************
5605 /* Function:
5606  void PLIB_USART_AddressMaskSet
5607  (
5608  USART_MODULE_ID index,
5609  uint8_t mask
5610  )
5611  Summary:
5612  Sets the address mask for the Address Detect mode.
5613  Description:
5614  This function sets the address mask for the Address Detect mode.
5615  This operation is atomic.
5616  Precondition:
5617  None.
5618  Parameters:
5619  index - Identifier for the device instance to be configured
5620  mask - Address match mask bits
5621  Returns:
5622  None.
5623  Example:
5624  <code>
5625 #define MY_USART_INSTANCE USART_ID_1
5626  uint8_t mask = 0x0F;
5627  PLIB_USART_AddressMaskSet (MY_USART_INSTANCE, mask);
5628  </code>
5629  Remarks:
5630  This feature may not be available on all devices. Please refer to the
5631  specific device data sheet to determine availability or use
5632  PLIB_USART_ExistsReceiverAddressMask in your application to determine
5633  whether this feature is available.
5634 */
5635 
5636 void
5638  USART_MODULE_ID index ,
5639  uint8_t mask ) ;
5640 //******************************************************************************
5641 /* Function:
5642  uint8_t PLIB_USART_AddressMaskGet
5643  (
5644  USART_MODULE_ID index
5645  )
5646  Summary:
5647  Gets the address mask for the Address Detect mode.
5648  Description:
5649  This function returns the address mask value being used for the Address
5650  Detect mode.
5651  This operation is atomic.
5652  Precondition:
5653  None.
5654  Parameters:
5655  index - Identifier for the device instance to be configured
5656  Returns:
5657  - mask - Address mask being used
5658  Example:
5659  <code>
5660 #define MY_USART_INSTANCE USART_ID_1
5661  uint8_t mask = 0;
5662  mask = PLIB_USART_AddressMaskGet (MY_USART_INSTANCE);
5663  </code>
5664  Remarks:
5665  This feature may not be available on all devices. Please refer to the
5666  specific device data sheet to determine availability or use
5667  PLIB_USART_ExistsReceiverAddressMask in your application to determine
5668  whether this feature is available.
5669 */
5670 
5671 uint8_t
5673  USART_MODULE_ID index ) ;
5674 //******************************************************************************
5675 /* Function:
5676  void PLIB_USART_ReceiverAddressDetectEnable ( USART_MODULE_ID index )
5677  Summary:
5678  Enables the Address Detect mode.
5679  Description:
5680  This function enables the Address Detect mode. If it is enabled, and the
5681  device is addressed, disable the Address Detect mode to continue receiving
5682  bytes.
5683  This operation is atomic.
5684  Precondition:
5685  None.
5686  Parameters:
5687  index - Identifier for the device instance to be configured
5688  Returns:
5689  None.
5690  Example:
5691  <code>
5692 #define MY_USART_INSTANCE USART_ID_1
5693  PLIB_USART_ReceiverAddressDetectEnable(MY_USART_INSTANCE);
5694  </code>
5695  Remarks:
5696  If 9 data bits are not selected, this bit has no effect.
5697  This feature may not be available on all devices. Please refer to the
5698  specific device data sheet to determine availability or use
5699  PLIB_USART_ExistsReceiverAddressDetect in your application to determine whether
5700  this feature is available.
5701 */
5702 
5703 void
5705  USART_MODULE_ID index ) ;
5706 //******************************************************************************
5707 /* Function:
5708  void PLIB_USART_ReceiverAddressDetectDisable ( USART_MODULE_ID index )
5709  Summary:
5710  Enables the Address Detect mode.
5711  Description:
5712  This function disables the Address Detect mode. If it is enabled, and the
5713  device is addressed, disable the Address Detect mode to continue receiving
5714  bytes.
5715  This operation is atomic.
5716  Precondition:
5717  None.
5718  Parameters:
5719  index - Identifier for the device instance to be configured
5720  Returns:
5721  None.
5722  Example:
5723  <code>
5724 #define MY_USART_INSTANCE USART_ID_1
5725  PLIB_USART_ReceiverAddressDetectDisable(MY_USART_INSTANCE);
5726  </code>
5727  Remarks:
5728  All bytes are received, and the 9th bit can be used as the parity bit.
5729  By default, the address detect is disabled.
5730 
5731  This feature may not be available on all devices. Please refer to the
5732  specific device data sheet to determine availability or use
5733  PLIB_USART_ExistsReceiverAddressDetect in your application to determine whether
5734  this feature is available.
5735 */
5736 
5737 void
5739  USART_MODULE_ID index ) ;
5740 //******************************************************************************
5741 /* Function:
5742  bool PLIB_USART_BaudRateAutoDetectIsComplete ( USART_MODULE_ID index )
5743  Summary:
5744  Gets the state of the automatic baud detection.
5745  Description:
5746  This function gets the state of the automatic baud detection and returns a '0'
5747  if the baud rate auto detection is complete.
5748  This operation is atomic.
5749  Precondition:
5750  None.
5751  Parameters:
5752  index - Identifier for the device instance to be configured
5753  Returns:
5754  - true - Baud rate detection is not complete
5755  - false - Baud rate detection is complete
5756  Example:
5757  <code>
5758 #define MY_USART_INSTANCE USART_ID_1
5759  PLIB_USART_BaudRateAutoDetectEnable(MY_USART_INSTANCE);
5760  // Wait until the baud rate is detected.
5761  while(!PLIB_USART_BaudRateAutoDetectIsComplete(MY_USART_INSTANCE));
5762  </code>
5763  Remarks:
5764  This feature may not be available on all devices. Please refer to the
5765  specific device data sheet to determine availability or use
5766  PLIB_USART_ExistsBaudRateAutoDetect in your application to determine whether
5767  this feature is available.
5768 */
5769 
5770 bool
5772  USART_MODULE_ID index ) ;
5773 //******************************************************************************
5774 /* Function:
5775  void PLIB_USART_BaudRateAutoDetectEnable ( USART_MODULE_ID index )
5776  Summary:
5777  Enables baud rate measurement on the next character, which requires reception
5778  of the Sync character.
5779  Description:
5780  This function enables the baud rate measurement on the next character,
5781  which requires reception of the Sync character.
5782  This operation is atomic.
5783  Precondition:
5784  None.
5785  Parameters:
5786  index - Identifier for the device instance to be configured
5787  Returns:
5788  None.
5789  Example:
5790  <code>
5791 #define MY_USART_INSTANCE USART_ID_1
5792  PLIB_USART_BaudRateAutoDetectEnable(MY_USART_INSTANCE);
5793  // Wait until the baud rate is detected.
5794  while(!PLIB_USART_BaudRateAutoDetectIsComplete(MY_USART_INSTANCE));
5795  </code>
5796  Remarks:
5797  This feature may not be available on all devices. Please refer to the
5798  specific device data sheet to determine availability or use
5799  PLIB_USART_ExistsBaudRateAutoDetect in your application to determine whether
5800  this feature is available.
5801 */
5802 
5803 void
5805  USART_MODULE_ID index ) ;
5806 //******************************************************************************
5807 /* Function:
5808  void PLIB_USART_TransmitterByteSend ( USART_MODULE_ID index, int8_t data )
5809  Summary:
5810  Data to be transmitted in the Byte mode.
5811  Description:
5812  The data is transmitted in the Byte mode for the specified USART module.
5813  This operation is atomic.
5814  Precondition:
5815  None.
5816  Parameters:
5817  index - Identifier for the device instance to be configured
5818  data - Data to be transmitted.
5819  Returns:
5820  None.
5821  Example:
5822  <code>
5823 #define MY_USART_INSTANCE USART_ID_1
5824  uint8_t data = 'a';
5825  if(!PLIB_USART_TransmitterBufferIsFull(MY_USART_INSTANCE))
5826  {
5827  PLIB_USART_TransmitterByteSend(MY_USART_INSTANCE, data);
5828  }
5829  </code>
5830  Remarks:
5831  This feature may not be available on all devices. Please refer to the
5832  specific device data sheet to determine availability or use
5833  PLIB_USART_ExistsTransmitter in your application to determine whether
5834  this feature is available.
5835 */
5836 
5837 void
5839  USART_MODULE_ID index ,
5840  int8_t data ) ;
5841 //******************************************************************************
5842 /* Function:
5843  int8_t PLIB_USART_ReceiverByteReceive ( USART_MODULE_ID index )
5844  Summary:
5845  Data to be received in the Byte mode.
5846  Description:
5847  The data to be received in Byte mode from the specified USART module.
5848  This operation is atomic.
5849  Call the functions PLIB_USART_ReceiverFramingErrorHasOccurred,
5850  PLIB_USART_ReceiverParityErrorHasOccurred and
5851  PLIB_USART_ReceiverOverrunHasOccurred to get any error that occurred.
5852  Precondition:
5853  None.
5854  Parameters:
5855  index - Identifier for the device instance to be configured
5856  Returns:
5857  - data - Data to be received
5858  Example:
5859  <code>
5860 #define MY_USART_INSTANCE USART_ID_1
5861  bool isError;
5862  uint8_t mydata;
5863  if(PLIB_USART_ReceiverDataIsAvailable(MY_USART_INSTANCE))
5864  {
5865  mydata = PLIB_USART_ReceiverByteReceive(MY_USART_INSTANCE);
5866  }
5867  isError = PLIB_USART_ReceiverFramingErrorHasOccurred(MY_USART_INSTANCE) |
5868  PLIB_USART_ReceiverParityErrorHasOccurred(MY_USART_INSTANCE) |
5869  PLIB_USART_ReceiverOverrunHasOccurred(MY_USART_INSTANCE);
5870  if(PLIB_USART_ReceiverOverrunHasOccurred(MY_USART_INSTANCE))
5871  {
5872  PLIB_USART_ReceiverOverrunErrorClear(MY_USART_INSTANCE);
5873  }
5874  </code>
5875  Remarks:
5876  This feature may not be available on all devices. Please refer to the
5877  specific device data sheet to determine availability or use
5878  PLIB_USART_ExistsReceiver in your application to determine whether
5879  this feature is available.
5880 */
5881 
5882 int8_t
5884  USART_MODULE_ID index ) ;
5885 //******************************************************************************
5886 /* Function:
5887  int16_t PLIB_USART_Receiver9BitsReceive ( USART_MODULE_ID index )
5888  Summary:
5889  Data to be received in the byte mode with the 9th bit.
5890  Description:
5891  The data to be received in Byte mode from the specified USART module.
5892  with the 9th bit.
5893  This operation is atomic.
5894  Precondition:
5895  None.
5896  Parameters:
5897  index - Identifier for the device instance to be configured
5898  Returns:
5899  - data - Data to be received
5900  Example:
5901  <code>
5902 #define MY_USART_INSTANCE USART_ID_1
5903  uint16_t mydata;
5904  if(PLIB_USART_ReceiverDataIsAvailable(MY_USART_INSTANCE))
5905  {
5906  mydata = PLIB_USART_Receiver9BitsReceive (MY_USART_INSTANCE);
5907  }
5908  </code>
5909  Remarks:
5910  This feature may not be available on all devices. Please refer to the
5911  specific device data sheet to determine availability or use
5912  PLIB_USART_ExistsReceiver9Bits in your application to determine
5913  whether this feature is available.
5914 */
5915 
5916 int16_t
5918  USART_MODULE_ID index ) ;
5919 //******************************************************************************
5920 /* Function:
5921  bool PLIB_USART_ReceiverAddressIsReceived ( USART_MODULE_ID index )
5922  Summary:
5923  Checks and return if the data received is an address.
5924  Description:
5925  Checks and return if the data received is an address. The address has
5926  the 9th bit set. If data received has the 9th bit set, the function returns true;
5927  otherwise, the function returns false.
5928  This operation is atomic.
5929  Precondition:
5930  The USART module should be configured to use the 9 data bits.
5931  Parameters:
5932  index - Identifier for the device instance to be configured
5933  Returns:
5934  - true - if the data received has the 9th bit set
5935  - false - if the address received has the 9th bit cleared
5936  Example:
5937  <code>
5938 #define MY_USART_INSTANCE USART_ID_1
5939  int8_t address;
5940  if(PLIB_USART_ReceiverAddressIsReceived(MY_USART_INSTANCE))
5941  {
5942  address = PLIB_USART_ReceiverByteReceive(MY_USART_INSTANCE);
5943  }
5944  </code>
5945  Remarks:
5946  This feature may not be available on all devices. Please refer to the
5947  specific device data sheet to determine availability or use
5948  PLIB_USART_ExistsReceiverAddressDetect in your application to determine whether
5949  this feature is available.
5950 */
5951 
5952 bool
5954  USART_MODULE_ID index ) ;
5955 //******************************************************************************
5956 /* Function:
5957  void PLIB_USART_Transmitter9BitsSend ( USART_MODULE_ID index,
5958  int8_t data, bool 9thBit )
5959  Summary:
5960  Data to be transmitted in the byte mode with the 9th bit.
5961  Description:
5962  The data is transmitted in the byte mode for the specified USART module,
5963  with 9th bit.
5964  This operation is atomic.
5965  Precondition:
5966  The USART module should be configured to use the 9 data bits.
5967  Parameters:
5968  index - Identifier for the device instance to be configured
5969  data - Data to be transmitted.
5970  9thBit - 9th bit of the data to be transmitted.
5971  Returns:
5972  None.
5973  Example:
5974  <code>
5975 #define MY_USART_INSTANCE USART_ID_1
5976  uint8_t data = 'a';
5977  if(!PLIB_USART_TransmitterBufferIsFull(MY_USART_INSTANCE))
5978  {
5979  PLIB_USART_Transmitter9BitsSend(MY_USART_INSTANCE, data, false);
5980  }
5981  </code>
5982  Remarks:
5983  This feature may not be available on all devices. Please refer to the
5984  specific device data sheet to determine availability or use
5985  PLIB_USART_ExistsTransmitter9BitsSend in your application to determine whether
5986  this feature is available.
5987 */
5988 
5989 void
5991  USART_MODULE_ID index ,
5992  int8_t data ,
5993  bool Bit9th ) ;
5994 //******************************************************************************
5995 /* Function:
5996  void PLIB_USART_TransmitterBreakSend ( USART_MODULE_ID index )
5997  Summary:
5998  Transmits the break character.
5999  Description:
6000  This function transmits the break character.
6001  This operation is atomic.
6002  Precondition:
6003  The application should wait for the transmitter to be idle, before calling
6004  this function.
6005  Parameters:
6006  index - Identifier for the device instance to be configured
6007  Returns:
6008  None.
6009  Example:
6010  <code>
6011 #define MY_USART_INSTANCE USART_ID_1
6012  // Wait for the Transmit buffer to be empty.
6013  while(PLIB_USART_TransmitterBufferIsFull(MY_USART_INSTANCE));
6014  // Transmit the break character.
6015  PLIB_USART_TransmitterBreakSend(MY_USART_INSTANCE);
6016  // wait for the break transmission to complete
6017  while(!PLIB_USART_TransmitterBreakSendIsComplete(MY_USART_INSTANCE));
6018  </code>
6019  Remarks:
6020  After the break has been transmitted, the application can start
6021  transmitting next bytes.
6022 
6023  This feature may not be available on all devices. Please refer to the
6024  specific device data sheet to determine availability or use
6025  PLIB_USART_ExistsTransmitterBreak in your application to determine whether
6026  this feature is available.
6027 */
6028 
6029 void
6031  USART_MODULE_ID index ) ;
6032 //******************************************************************************
6033 /* Function:
6034  bool PLIB_USART_TransmitterBreakSendIsComplete ( USART_MODULE_ID index )
6035  Summary:
6036  Returns the status of the break transmission
6037  Description:
6038  The function returns the status of the break transmission.
6039  This operation is atomic.
6040  Precondition:
6041  None.
6042  Parameters:
6043  index - Identifier for the device instance to be configured
6044  Returns:
6045  - true - Transmit break on the next transmission
6046  - false - Break transmission completed or not started
6047  Example:
6048  <code>
6049 #define MY_USART_INSTANCE USART_ID_1
6050  // Wait for the Transmit buffer to be empty.
6051  while(PLIB_USART_TransmitterBufferIsFull(MY_USART_INSTANCE));
6052  // Transmit the break character.
6053  PLIB_USART_TransmitterBreakSend(MY_USART_INSTANCE);
6054  // wait for the break transmission to complete
6055  while(!PLIB_USART_TransmitterBreakSendIsComplete(MY_USART_INSTANCE));
6056  </code>
6057  Remarks:
6058  After the break has been transmitted, the application can start
6059  transmitting next bytes.
6060 
6061  This feature may not be available on all devices. Please refer to the
6062  specific device data sheet to determine availability or use
6063  PLIB_USART_ExistsTransmitterBreak in your application to determine whether
6064  this feature is available.
6065 */
6066 
6067 bool
6069  USART_MODULE_ID index ) ;
6070 //******************************************************************************
6071 /* Function:
6072  bool PLIB_USART_ReceiverDataIsAvailable ( USART_MODULE_ID index )
6073  Summary:
6074  Identifies if the receive data is available for the specified USART module.
6075  Description:
6076  This function identifies if the receive data is available for the specified
6077  USART module.
6078  This operation is atomic.
6079  Precondition:
6080  None.
6081  Parameters:
6082  index - Identifier for the device instance to be configured
6083  Returns:
6084  - true - The data is available
6085  - false - The data is not available
6086  Example:
6087  <code>
6088 #define MY_USART_INSTANCE USART_ID_1
6089  int8_t mydata;
6090  if(PLIB_USART_ReceiverDataIsAvailable(MY_USART_INSTANCE))
6091  {
6092  mydata = PLIB_USART_ReceiverByteReceive(MY_USART_INSTANCE);
6093  }
6094  </code>
6095  Remarks:
6096  This feature may not be available on all devices. Please refer to the
6097  specific device data sheet to determine availability or use
6098  PLIB_USART_ExistsReceiverDataAvailableStatus in your application to determine
6099  whether this feature is available.
6100 */
6101 
6102 bool
6104  USART_MODULE_ID index ) ;
6105 //******************************************************************************
6106 /* Function:
6107  void PLIB_USART_ReceiverOverrunErrorClear ( USART_MODULE_ID index )
6108  Summary:
6109  Clears a USART vverrun error.
6110  Description:
6111  This function clears an overrun error. Clearing the error, resets the receive buffer.
6112  This operation is atomic.
6113  Precondition:
6114  None.
6115  Parameters:
6116  index - Identifier for the device instance to be configured
6117  Returns:
6118  None.
6119  Example:
6120  <code>
6121 #define MY_USART_INSTANCE USART_ID_1
6122  if(PLIB_USART_ReceiverOverrunHasOccurred(MY_USART_INSTANCE))
6123  {
6124  PLIB_USART_ReceiverOverrunErrorClear(MY_USART_INSTANCE);
6125  }
6126  </code>
6127  Remarks:
6128  WARNING: Calling this API will clear all of the previously received data.
6129 
6130  This feature may not be available on all devices. Please refer to the
6131  specific device data sheet to determine availability or use
6132  PLIB_USART_ExistsReceiverOverrunStatus in your application to determine
6133  whether this feature is available.
6134 */
6135 
6136 void
6138  USART_MODULE_ID index ) ;
6139 //******************************************************************************
6140 /* Function:
6141  bool PLIB_USART_TransmitterBufferIsFull ( USART_MODULE_ID index )
6142  Summary:
6143  Gets the transmit buffer full status.
6144  Description:
6145  This function gets the transmit status of the specified USART module.
6146  This operation is atomic.
6147  Precondition:
6148  None.
6149  Parameters:
6150  index - Identifier for the device instance to be configured
6151  Returns:
6152  - true - The transmit buffer is full
6153  - false - The transmit buffer is not full, at least one more
6154  character can be written
6155  Example:
6156  <code>
6157 #define MY_USART_INSTANCE USART_ID_1
6158  // Wait for the Transmit buffer to be empty.
6159  while(PLIB_USART_TransmitterBufferIsFull(MY_USART_INSTANCE));
6160  // Transmit the break character.
6161  PLIB_USART_TransmitterBreakSend(MY_USART_INSTANCE);
6162  </code>
6163  Remarks:
6164  This feature may not be available on all devices. Please refer to the
6165  specific device data sheet to determine availability or use
6166  PLIB_USART_ExistsTransmitterBufferFullStatus in your application to determine
6167  whether this feature is available.
6168 */
6169 
6170 bool
6172  USART_MODULE_ID index ) ;
6173 //******************************************************************************
6174 /* Function:
6175  bool PLIB_USART_TransmitterIsEmpty ( USART_MODULE_ID index )
6176  Summary:
6177  Gets the transmit shift register empty status.
6178  Description:
6179  This function gets the transmit shift register empty status.
6180  This operation is atomic.
6181  Precondition:
6182  None.
6183  Parameters:
6184  index - Identifier for the device instance to be configured
6185  Returns:
6186  - true - The transmit shift register is empty
6187  - false - The transmit shift register is not empty
6188  Example:
6189  <code>
6190 #define MY_USART_INSTANCE USART_ID_1
6191  // Wait for the Transmit buffer to be empty.
6192  while(!PLIB_USART_TransmitterIsEmpty(MY_USART_INSTANCE));
6193  // Transmit the break character.
6194  PLIB_USART_TransmitterBreakSend(MY_USART_INSTANCE);
6195  </code>
6196  Remarks:
6197  This feature may not be available on all devices. Please refer to the
6198  specific device data sheet to determine availability or use
6199  PLIB_USART_ExistsTransmitterEmptyStatus in your application to determine
6200  whether this feature is available.
6201 */
6202 
6203 bool
6205  USART_MODULE_ID index ) ;
6206 //******************************************************************************
6207 /* Function:
6208  bool PLIB_USART_ReceiverFramingErrorHasOccurred ( USART_MODULE_ID index )
6209  Summary:
6210  Gets the framing error status.
6211  Description:
6212  This function gets the framing error status.
6213  This operation is atomic.
6214  Precondition:
6215  None.
6216  Parameters:
6217  index - Identifier for the device instance to be configured
6218  Returns:
6219  - true - The framing error was detected on the current character
6220  - false - The framing error was not detected on the current
6221  character
6222  Example:
6223  <code>
6224 #define MY_USART_INSTANCE USART_ID_1
6225  status = PLIB_USART_ReceiverFramingErrorHasOccurred(MY_USART_INSTANCE);
6226  </code>
6227  Remarks:
6228  Reading the error clears the error.
6229  This feature may not be available on all devices. Please refer to the
6230  specific device data sheet to determine availability or use
6231  PLIB_USART_ExistsReceiverFramingErrorStatus in your application to determine
6232  whether this feature is available.
6233 */
6234 
6235 bool
6237  USART_MODULE_ID index ) ;
6238 //******************************************************************************
6239 /* Function:
6240  bool PLIB_USART_ReceiverParityErrorHasOccurred ( USART_MODULE_ID index )
6241  Summary:
6242  Gets the parity error status.
6243  Description:
6244  This function gets the parity error status.
6245  This operation is atomic.
6246  Precondition:
6247  None.
6248  Parameters:
6249  index - Identifier for the device instance to be configured
6250  Returns:
6251  - true - The parity error was detected on the current character
6252  - false - The parity error was not detected on the current character
6253  Example:
6254  <code>
6255 #define MY_USART_INSTANCE USART_ID_1
6256  status = PLIB_USART_ReceiverParityErrorHasOccurred(MY_USART_INSTANCE);
6257  </code>
6258  Remarks:
6259  Reading the error clears the error.
6260  A Parity error is irrelevant in case of 9-bit mode.
6261  This feature may not be available on all devices. Please refer to the
6262  specific device data sheet to determine availability or use
6263  PLIB_USART_ExistsReceiverParityErrorStatus in your application to determine
6264  whether this feature is available.
6265 */
6266 
6267 bool
6269  USART_MODULE_ID index ) ;
6270 //******************************************************************************
6271 /* Function:
6272  bool PLIB_USART_ReceiverOverrunHasOccurred ( USART_MODULE_ID index )
6273  Summary:
6274  Identifies if there was a receiver overrun error.
6275  Description:
6276  This function identifies if there was a receiver overrun error.
6277  This operation is atomic.
6278  Precondition:
6279  None.
6280  Parameters:
6281  index - Identifier for the device instance to be configured
6282  Returns:
6283  - true - The receive buffer has overflowed
6284  - false - The receive buffer has not overflowed
6285  Example:
6286  <code>
6287 #define MY_USART_INSTANCE USART_ID_1
6288  if(PLIB_USART_ReceiverOverrunHasOccurred(MY_USART_INSTANCE))
6289  {
6290  PLIB_USART_ReceiverOverrunErrorClear(MY_USART_INSTANCE);
6291  }
6292  </code>
6293  Remarks:
6294  This feature may not be available on all devices. Please refer to the
6295  specific device data sheet to determine availability or use
6296  PLIB_USART_ExistsReceiverOverrunStatus in your application to determine
6297  whether this feature is available.
6298 */
6299 
6300 bool
6302  USART_MODULE_ID index ) ;
6303 //******************************************************************************
6304 /* Function:
6305  bool PLIB_USART_ReceiverIsIdle ( USART_MODULE_ID index )
6306  Summary:
6307  Identifies if the receiver is idle.
6308  Description:
6309  This function identifies if the receiver is idle.
6310  This operation is atomic.
6311  Precondition:
6312  None.
6313  Parameters:
6314  index - Identifier for the device instance to be configured
6315  Returns:
6316  - true - The receive buffer is idle
6317  - false - The receive buffer is not idle
6318  Example:
6319  <code>
6320 #define MY_USART_INSTANCE USART_ID_1
6321  int8_t mydata;
6322  if(PLIB_USART_ReceiverIsIdle(MY_USART_INSTANCE))
6323  {
6324  mydata = PLIB_USART_ReceiverByteReceive(MY_USART_INSTANCE);
6325  }
6326  </code>
6327  Remarks:
6328  This feature may not be available on all devices. Please refer to the
6329  specific device data sheet to determine availability or use
6330  PLIB_USART_ExistsReceiverIdleStatus in your application to determine
6331  whether this feature is available.
6332 */
6333 
6334 bool
6336  USART_MODULE_ID index ) ;
6337 //******************************************************************************
6338 /* Function:
6339  void PLIB_USART_ReceiverEnable ( USART_MODULE_ID index )
6340  Summary:
6341  Enables the USART receiver.
6342  Description:
6343  This function enables the USART receiver.
6344  This operation is atomic.
6345  Precondition:
6346  None.
6347  Parameters:
6348  index - Identifier for the device instance to be configured
6349  Returns:
6350  None.
6351  Example:
6352  <code>
6353 #define MY_USART_INSTANCE USART_ID_1
6354  PLIB_USART_ReceiverEnable(MY_USART_INSTANCE);
6355  </code>
6356  Remarks:
6357  This feature may not be available on all devices. Please refer to the
6358  specific device data sheet to determine availability or use
6359  PLIB_USART_ExistsReceiverEnable in your application to determine
6360  whether this feature is available.
6361 */
6362 
6363 void
6365  USART_MODULE_ID index ) ;
6366 //******************************************************************************
6367 /* Function:
6368  void PLIB_USART_ReceiverDisable ( USART_MODULE_ID index )
6369  Summary:
6370  Disables the USART receiver.
6371  Description:
6372  This function disables the USART receiver.
6373  This operation is atomic.
6374  Precondition:
6375  None.
6376  Parameters:
6377  index - Identifier for the device instance to be configured
6378  Returns:
6379  None.
6380  Example:
6381  <code>
6382 #define MY_USART_INSTANCE USART_ID_1
6383  PLIB_USART_ReceiverDisable(MY_USART_INSTANCE);
6384  </code>
6385  Remarks:
6386  This feature may not be available on all devices. Please refer to the
6387  specific device data sheet to determine availability or use
6388  PLIB_USART_ExistsReceiverEnable in your application to determine
6389  whether this feature is available.
6390 */
6391 
6392 void
6394  USART_MODULE_ID index ) ;
6395 //******************************************************************************
6396 /* Function:
6397  void PLIB_USART_TransmitterIdleIsLowEnable ( USART_MODULE_ID index )
6398  Summary:
6399  Enables the Transmit Idle Low state.
6400  Description:
6401  This function enables the Transmit Idle Low state. In the USART Synchronous
6402  mode, this function configures that the TX polarity, the idle state is low.
6403  When IrDA is enabled, this function sets that IrDA encoded Transmit Idle
6404  state to a '1'.
6405  This operation is atomic.
6406  Precondition:
6407  None.
6408  Parameters:
6409  index - Identifier for the device instance to be configured
6410  Returns:
6411  None.
6412  Example:
6413  <code>
6414 #define MY_USART_INSTANCE USART_ID_1
6415  PLIB_USART_TransmitterIdleIsLowEnable(MY_USART_INSTANCE);
6416  </code>
6417  Remarks:
6418  This feature may not be available on all devices. Please refer to the
6419  specific device data sheet to determine availability or use
6420  PLIB_USART_ExistsTransmitterIdleIsLow in your application to determine
6421  whether this feature is available.
6422 */
6423 
6424 void
6426  USART_MODULE_ID index ) ;
6427 //******************************************************************************
6428 /* Function:
6429  void PLIB_USART_TransmitterIdleIsLowDisable ( USART_MODULE_ID index )
6430  Summary:
6431  Disables the Transmit Idle Low state.
6432  Description:
6433  This function disables the Transmit Idle Low state. In USART Synchronous mode,
6434  this function configures that the TX polarity the idle state is high.
6435  When IrDA is enabled, this function sets the IrDA encoded Transmit Idle
6436  state to a '0'.
6437  This operation is atomic.
6438  Precondition:
6439  None.
6440  Parameters:
6441  index - Identifier for the device instance to be configured
6442  Returns:
6443  None.
6444  Example:
6445  <code>
6446 #define MY_USART_INSTANCE USART_ID_1
6447  PLIB_USART_TransmitterIdleIsLowDisable(MY_USART_INSTANCE);
6448  </code>
6449  Remarks:
6450  This feature may not be available on all devices. Please refer to the
6451  specific device data sheet to determine availability or use
6452  PLIB_USART_ExistsTransmitterIdleIsLow in your application to determine
6453  whether this feature is available.
6454 */
6455 
6456 void
6458  USART_MODULE_ID index ) ;
6459 //******************************************************************************
6460 /* Function:
6461  void PLIB_USART_ReceiverIdleStateLowEnable ( USART_MODULE_ID index )
6462  Summary:
6463  Enables receive polarity inversion.
6464  Description:
6465  This function enables receive polarity inversion. In the USART Synchronous mode,
6466  this function configures that the data is inverted.
6467  This operation is atomic.
6468  Precondition:
6469  None.
6470  Parameters:
6471  index - Identifier for the device instance to be configured
6472  Returns:
6473  None.
6474  Example:
6475  <code>
6476 #define MY_USART_INSTANCE USART_ID_1
6477  PLIB_USART_ReceiverIdleStateLowEnable(MY_USART_INSTANCE);
6478  </code>
6479  Remarks:
6480  This feature may not be available on all devices. Please refer to the
6481  specific device data sheet to determine availability or use
6482  PLIB_USART_ExistsReceiverIdleStateLowEnable in your application to determine
6483  whether this feature is available.
6484 */
6485 
6486 void
6488  USART_MODULE_ID index ) ;
6489 //******************************************************************************
6490 /* Function:
6491  void PLIB_USART_ReceiverIdleStateLowDisable ( USART_MODULE_ID index );
6492  Summary:
6493  Disables receive polarity inversion.
6494  This operation is atomic.
6495  Description:
6496  This function disables receive polarity inversion. In the USART Synchronous
6497  mode, this function configures that the data is not inverted.
6498  Precondition:
6499  None.
6500  Parameters:
6501  index - Identifier for the device instance to be configured
6502  Returns:
6503  None.
6504  Example:
6505  <code>
6506 #define MY_USART_INSTANCE USART_ID_1
6507  PLIB_USART_ReceiverIdleStateLowDisable(MY_USART_INSTANCE);
6508  </code>
6509  Remarks:
6510  This feature may not be available on all devices. Please refer to the
6511  specific device data sheet to determine availability or use
6512  PLIB_USART_ExistsReceiverIdleStateLowEnable in your application to determine
6513  whether this feature is available.
6514 */
6515 
6516 void
6518  USART_MODULE_ID index ) ;
6519 //******************************************************************************
6520 /* Function:
6521  void PLIB_USART_BaudRateHighEnable ( USART_MODULE_ID index )
6522  Summary:
6523  Enables high baud rate selection.
6524  Description:
6525  This function enables high baud rate selection.
6526  This operation is atomic.
6527  Precondition:
6528  None.
6529  Parameters:
6530  index - Identifier for the device instance to be configured
6531  Returns:
6532  None.
6533  Example:
6534  <code>
6535 #define MY_USART_INSTANCE USART_ID_1
6536  PLIB_USART_BaudRateHighEnable(MY_USART_INSTANCE);
6537  </code>
6538  Remarks:
6539  This feature may not be available on all devices. Please refer to the
6540  specific device data sheet to determine availability or use
6541  PLIB_USART_ExistsBaudRateHigh in your application to determine
6542  whether this feature is available.
6543 */
6544 
6545 void
6547  USART_MODULE_ID index ) ;
6548 //******************************************************************************
6549 /* Function:
6550  void PLIB_USART_BaudRateHighDisable ( USART_MODULE_ID index )
6551  Summary:
6552  Disables the high baud rate selection.
6553  Description:
6554  This function disables the high baud rate selection.
6555  This operation is atomic.
6556  Precondition:
6557  None.
6558  Parameters:
6559  index - Identifier for the device instance to be configured
6560  Returns:
6561  None.
6562  Example:
6563  <code>
6564 #define MY_USART_INSTANCE USART_ID_1
6565  PLIB_USART_BaudRateHighDisable(MY_USART_INSTANCE);
6566  </code>
6567  Remarks:
6568  This feature may not be available on all devices. Please refer to the
6569  specific device data sheet to determine availability or use
6570  PLIB_USART_ExistsBaudRateHigh in your application to determine
6571  whether this feature is available.
6572 */
6573 
6574 void
6576  USART_MODULE_ID index ) ;
6577 //******************************************************************************
6578 /* Function:
6579  void PLIB_USART_TransmitterInterruptModeSelect( USART_MODULE_ID index,
6580  USART_TRANSMIT_INTR_MODE interruptMode )
6581  Summary:
6582  Sets the USART transmitter interrupt mode.
6583  Description:
6584  This function sets the condition in which the USART module should generate
6585  an interrupt.
6586  This operation is atomic.
6587  Precondition:
6588  None.
6589  Parameters:
6590  index - Identifier for the device instance to be configured
6591  interruptMode - Interrupt mode; for possible configurations, refer to
6592  USART_TRANSMIT_INTR_MODE
6593  Returns:
6594  None.
6595  Example:
6596  <code>
6597 #define MY_USART_INSTANCE USART_ID_1
6598  PLIB_USART_TransmitterInterruptModeSelect(MY_USART_INSTANCE,
6599  USART_TRANSMIT_FIFO_EMPTY );
6600  </code>
6601  Remarks:
6602  This feature may not be available on all devices. Please refer to the
6603  specific device data sheet to determine availability or use
6604  PLIB_USART_ExistsTransmitterInterruptMode in your application to determine
6605  whether this feature is available.
6606 */
6607 
6608 void
6610  USART_MODULE_ID index ,
6611  USART_TRANSMIT_INTR_MODE fifolevel ) ;
6612 //******************************************************************************
6613 /* Function:
6614  void PLIB_USART_ReceiverInterruptModeSelect( USART_MODULE_ID index,
6615  USART_RECEIVE_INTR_MODE interruptMode )
6616  Summary:
6617  Sets the USART receiver FIFO level.
6618  Description:
6619  This function sets the USART receiver FIFO level.
6620  This operation is atomic.
6621  Precondition:
6622  None.
6623  Parameters:
6624  index - Identifier for the device instance to be configured
6625  fifolevel - For possible configurations, refer to USART_RECEIVE_INTR_MODE
6626  Returns:
6627  None.
6628  Example:
6629  <code>
6630 #define MY_USART_INSTANCE USART_ID_1
6631  PLIB_USART_ReceiverInterruptModeSelect(MY_USART_INSTANCE,
6632  USART_RECEIVE_FIFO_ONE_CHAR );
6633  </code>
6634  Remarks:
6635  This feature may not be available on all devices. Please refer to the
6636  specific device data sheet to determine availability or use
6637  PLIB_USART_ExistsReceiverInterruptMode in your application to determine
6638  whether this feature is available.
6639 */
6640 
6641 void
6643  USART_MODULE_ID index ,
6644  USART_RECEIVE_INTR_MODE interruptMode ) ;
6645 //******************************************************************************
6646 /* Function:
6647  void PLIB_USART_LineControlModeSelect(USART_MODULE_ID index,
6648  USART_LINECONTROL_MODE dataFlowConfig)
6649  Summary:
6650  Sets the data flow configuration.
6651  Description:
6652  This function sets the USART data flow configuration based on the mask
6653  provided and the specified baud rate.
6654  Precondition:
6655  None.
6656  Parameters:
6657  index - Identifier for the device instance to be configured
6658  mode - For possible data flow configurations, refer to
6659  USART_LINECONTROL_MODE
6660  Returns:
6661  None.
6662  Example:
6663  <code>
6664 #define MY_USART_INSTANCE USART_ID_1
6665  PLIB_USART_LineControlModeSelect(MY_USART_INSTANCE, \
6666  USART_8N1);
6667  </code>
6668  Remarks:
6669  This feature may not be available on all devices. Please refer to the
6670  specific device data sheet to determine availability or use
6671  PLIB_USART_ExistsLineControlMode in your application to determine
6672  whether this feature is available.
6673 */
6674 
6675 void
6677  USART_MODULE_ID index ,
6678  USART_LINECONTROL_MODE dataFlowConfig ) ;
6679 //******************************************************************************
6680 /* Function:
6681  void PLIB_USART_HandshakeModeSelect(USART_MODULE_ID index,
6682  USART_HANDSHAKE_MODE handshakeConfig)
6683  Summary:
6684  Sets the data flow configuration.
6685  Description:
6686  This function sets the USART data flow configuration based on the mask
6687  provided and the specified baud rate.
6688  Precondition:
6689  None.
6690  Parameters:
6691  index - Identifier for the device instance to be configured
6692  mode - For possible data flow configurations, refer to
6693  USART_HANDSHAKE_MODE
6694  Returns:
6695  None.
6696  Example:
6697  <code>
6698 #define MY_USART_INSTANCE USART_ID_1
6699  PLIB_USART_HandshakeModeSelect(MY_USART_INSTANCE, \
6700  USART_HANDSHAKE_MODE_SIMPLEX);
6701  </code>
6702  Remarks:
6703  This feature may not be available on all devices. Please refer to the
6704  specific device data sheet to determine availability or use
6705  PLIB_USART_ExistsHandshakeMode in your application to determine
6706  whether this feature is available.
6707 */
6708 
6709 void
6711  USART_MODULE_ID index ,
6712  USART_HANDSHAKE_MODE handshakeConfig ) ;
6713 //******************************************************************************
6714 /* Function:
6715  void PLIB_USART_ReceiverAddressAutoDetectEnable(USART_MODULE_ID index,
6716  int8_t Mask)
6717  Summary:
6718  Setup the automatic Address Detect mode.
6719  Description:
6720  This function configures the automatic Address Detect mode. Uses the mask as
6721  the address character for automatic address detection.
6722  This operation is atomic.
6723  Precondition:
6724  None.
6725  Parameters:
6726  index - Identifier for the device instance to be configured
6727  Mask - Address character to be used, when enabled
6728  Returns:
6729  None.
6730  Example:
6731  <code>
6732 #define MY_USART_INSTANCE USART_ID_1
6733  PLIB_USART_ReceiverAddressAutoDetectEnable(MY_USART_INSTANCE,
6734  MY_DEVICE_ADDRESS);
6735  </code>
6736  Remarks:
6737  This feature may not be available on all devices. Please refer to the
6738  specific device data sheet to determine availability or use
6739  PLIB_USART_ExistsReceiverAddressAutoDetect in your application to determine
6740  whether this feature is available.
6741 */
6742 
6743 void
6745  USART_MODULE_ID index ,
6746  int8_t Mask ) ;
6747 //******************************************************************************
6748 /* Function:
6749  void PLIB_USART_ReceiverAddressAutoDetectDisable (
6750  USART_MODULE_ID index )
6751  Summary:
6752  Disables the automatic Address Detect mode.
6753  Description:
6754  This function disables the automatic Address Detect mode.
6755  This operation is atomic.
6756  Precondition:
6757  None.
6758  Parameters:
6759  index - Identifier for the device instance to be configured
6760  Returns:
6761  None.
6762  Example:
6763  <code>
6764 #define MY_USART_INSTANCE USART_ID_1
6765  PLIB_USART_ReceiverAddressAutoDetectDisable(MY_USART_INSTANCE);
6766  </code>
6767  Remarks:
6768  This feature may not be available on all devices. Please refer to the
6769  specific device data sheet to determine availability or use
6770  PLIB_USART_ExistsReceiverAddressAutoDetect in your application to determine
6771  whether this feature is available.
6772 */
6773 
6774 void
6776  USART_MODULE_ID index ) ;
6777 //******************************************************************************
6778 /* Function:
6779  void PLIB_USART_IrDAEnable ( USART_MODULE_ID index )
6780  Summary:
6781  Enables the IrDA encoder and decoder.
6782  Description:
6783  This function enables the IrDA encoder and decoder.
6784  This operation is atomic.
6785  Precondition:
6786  None.
6787  Parameters:
6788  index - Identifier for the device instance to be configured
6789  Returns:
6790  None.
6791  Example:
6792  <code>
6793 #define MY_USART_INSTANCE USART_ID_1
6794  PLIB_USART_IrDAEnable(MY_USART_INSTANCE);
6795  </code>
6796  Remarks:
6797  This feature may not be available on all devices. Please refer to the
6798  specific device data sheet to determine availability or use
6799  PLIB_USART_ExistsIrDA in your application to determine
6800  whether this feature is available.
6801 */
6802 
6803 void
6805  USART_MODULE_ID index ) ;
6806 //******************************************************************************
6807 /* Function:
6808  void PLIB_USART_IrDADisable ( USART_MODULE_ID index )
6809  Summary:
6810  Disables the IrDA encoder and decoder.
6811  Description:
6812  This function disables the IrDA encoder and decoder.
6813  This operation is atomic.
6814  Precondition:
6815  None.
6816  Parameters:
6817  index - Identifier for the device instance to be configured
6818  Returns:
6819  None.
6820  Example:
6821  <code>
6822 #define MY_USART_INSTANCE USART_ID_1
6823  PLIB_USART_IrDADisable(MY_USART_INSTANCE);
6824  </code>
6825  Remarks:
6826  By default, the IrDA Encoder and Decoder are disabled.
6827 
6828  This feature may not be available on all devices. Please refer to the
6829  specific device data sheet to determine availability or use
6830  PLIB_USART_ExistsIrDA in your application to determine
6831  whether this feature is available.
6832 */
6833 
6834 void
6836  USART_MODULE_ID index ) ;
6837 //******************************************************************************
6838 /* Function:
6839  void PLIB_USART_LoopbackEnable ( USART_MODULE_ID index )
6840  Summary:
6841  Enables Loopback mode.
6842  Description:
6843  This function enables Loopback mode.
6844  This operation is atomic.
6845  Precondition:
6846  None.
6847  Parameters:
6848  index - Identifier for the device instance to be configured
6849  Returns:
6850  None.
6851  Example:
6852  <code>
6853 #define MY_USART_INSTANCE USART_ID_1
6854  PLIB_USART_LoopbackEnable(MY_USART_INSTANCE);
6855  </code>
6856  Remarks:
6857  By default, Loopback mode is disabled.
6858 
6859  This feature may not be available on all devices. Please refer to the
6860  specific device data sheet to determine availability or use
6861  PLIB_USART_ExistsLoopback in your application to determine
6862  whether this feature is available.
6863 */
6864 
6865 void
6867  USART_MODULE_ID index ) ;
6868 //******************************************************************************
6869 /* Function:
6870  void PLIB_USART_LoopbackDisable ( USART_MODULE_ID index )
6871  Summary:
6872  Disables Loopback mode.
6873  Description:
6874  This function disables Loopback mode.
6875  This operation is atomic.
6876  Precondition:
6877  None.
6878  Parameters:
6879  index - Identifier for the device instance to be configured
6880  Returns:
6881  None.
6882  Example:
6883  <code>
6884 #define MY_USART_INSTANCE USART_ID_1
6885  PLIB_USART_LoopbackDisable(MY_USART_INSTANCE);
6886  </code>
6887  Remarks:
6888  By default, Loopback mode is disabled.
6889  This feature may not be available on all devices. Please refer to the
6890  specific device data sheet to determine availability or use
6891  PLIB_USART_ExistsLoopback in your application to determine
6892  whether this feature is available.
6893 */
6894 
6895 void
6897  USART_MODULE_ID index ) ;
6898 //******************************************************************************
6899 /* Function:
6900  void PLIB_USART_OperationModeSelect(USART_MODULE_ID index,
6901  USART_OPERATION_MODE operationmode)
6902  Summary:
6903  Configures the operation mode of the USART module.
6904  Description:
6905  This function configures the operation mode of the USART (i.e., controls the
6906  pins used by the USART module). Refer to USART_OPERATION_MODE for the
6907  possible settings.
6908  Precondition:
6909  None.
6910  Parameters:
6911  index - Identifier for the device instance to be configured
6912  operationmode - One of the possible values from USART_OPERATION_MODE
6913  Returns:
6914  None.
6915  Example:
6916  <code>
6917 #define MY_USART_INSTANCE USART_ID_1
6918  PLIB_USART_OperationModeSelect(MY_USART_INSTANCE, USART_ENABLE_TX_RX_BCLK_USED);
6919  </code>
6920  Remarks:
6921  This feature may not be available on all devices. Please refer to the
6922  specific device data sheet to determine availability or use
6923  PLIB_USART_ExistsOperationMode in your application to determine
6924  whether this feature is available.
6925 */
6926 
6927 void
6929  USART_MODULE_ID index ,
6930  USART_OPERATION_MODE operationmode ) ;
6931 //******************************************************************************
6932 /* Function:
6933  void PLIB_USART_StopInIdleEnable ( USART_MODULE_ID index )
6934  Summary:
6935  Discontinues operation when the device enters Idle mode.
6936  Description:
6937  This function enables the USART module to discontinue operation when the
6938  device enters Idle mode.
6939  This operation is atomic.
6940  Precondition:
6941  None.
6942  Parameters:
6943  index - Identifier for the device instance to be configured
6944  Returns:
6945  None.
6946  Example:
6947  <code>
6948 #define MY_USART_INSTANCE USART_ID_1
6949  PLIB_USART_StopInIdleEnable(MY_USART_INSTANCE);
6950  </code>
6951  Remarks:
6952  This feature may not be available on all devices. Please refer to the
6953  specific device data sheet to determine availability or use
6954  PLIB_USART_ExistsStopInIdle in your application to determine
6955  whether this feature is available.
6956 */
6957 
6958 void
6960  USART_MODULE_ID index ) ;
6961 //******************************************************************************
6962 /* Function:
6963  void PLIB_USART_StopInIdleDisable ( USART_MODULE_ID index )
6964  Summary:
6965  Disables the Stop in Idle mode (the USART module continues operation when
6966  the device is in Idle mode).
6967  Description:
6968  This function disables the Stop in Idle mode. The USART module continues
6969  operation when the device is in Idle mode.
6970  This operation is atomic.
6971  Precondition:
6972  None.
6973  Parameters:
6974  index - Identifier for the device instance to be configured
6975  Returns:
6976  None.
6977  Example:
6978  <code>
6979 #define MY_USART_INSTANCE USART_ID_1
6980  PLIB_USART_StopInIdleDisable(MY_USART_INSTANCE);
6981  </code>
6982  Remarks:
6983  By default, the USART module will continue operation in Idle mode.
6984 
6985  This feature may not be available on all devices. Please refer to the
6986  specific device data sheet to determine availability or use
6987  PLIB_USART_ExistsStopInIdle in your application to determine
6988  whether this feature is available.
6989 */
6990 
6991 void
6993  USART_MODULE_ID index ) ;
6994 //******************************************************************************
6995 /* Function:
6996  void PLIB_USART_WakeOnStartEnable ( USART_MODULE_ID index )
6997  Summary:
6998  Enables the wake-up on start bit detection feature during Sleep mode.
6999  Description:
7000  This function enables the wake-up on start feature during Sleep mode.
7001  This operation is atomic.
7002  Precondition:
7003  None.
7004  Parameters:
7005  index - Identifier for the device instance to be configured
7006  Returns:
7007  None.
7008  Example:
7009  <code>
7010 #define MY_USART_INSTANCE USART_ID_1
7011  PLIB_USART_WakeOnStartEnable(MY_USART_INSTANCE);
7012  </code>
7013  Remarks:
7014  This feature may not be available on all devices. Please refer to the
7015  specific device data sheet to determine availability or use
7016  PLIB_USART_ExistsWakeOnStart in your application to determine
7017  whether this feature is available.
7018 */
7019 
7020 void
7022  USART_MODULE_ID index ) ;
7023 //******************************************************************************
7024 /* Function:
7025  void PLIB_USART_WakeOnStartDisable ( USART_MODULE_ID index )
7026  Summary:
7027  Disables the wake-up on start bit detection feature during Sleep mode.
7028  Description:
7029  This function disables the wake-up on start bit detection feature during
7030  Sleep mode.
7031  This operation is atomic.
7032  Precondition:
7033  None.
7034  Parameters:
7035  index - Identifier for the device instance to be configured
7036  Returns:
7037  None.
7038  Example:
7039  <code>
7040 #define MY_USART_INSTANCE USART_ID_1
7041  PLIB_USART_WakeOnStartDisable(MY_USART_INSTANCE);
7042  </code>
7043  Remarks:
7044  This feature may not be available on all devices. Please refer to the
7045  specific device data sheet to determine availability or use
7046  PLIB_USART_ExistsWakeOnStart in your application to determine
7047  whether this feature is available.
7048 */
7049 
7050 void
7052  USART_MODULE_ID index ) ;
7053 //******************************************************************************
7054 /* Function:
7055  bool PLIB_USART_WakeOnStartIsEnabled ( USART_MODULE_ID index )
7056  Summary:
7057  Gets the state of the sync break event completion.
7058  Description:
7059  This function returns the status of the sync break event, when called
7060  after enabling using PLIB_USART_WakeOnStartEnable.
7061  This operation is atomic.
7062  Precondition:
7063  None.
7064  Parameters:
7065  index - Identifier for the device instance to be configured
7066  Returns:
7067  None.
7068  Example:
7069  <code>
7070 #define MY_USART_INSTANCE USART_ID_1
7071  //Call the interface just prior to entering the sleep mode.
7072  PLIB_USART_WakeOnStartEnable(MY_USART_INSTANCE);
7073  // Check the status if the Sync break event is over.
7074  if(PLIB_USART_WakeOnStartIsEnabled(MY_USART_INSTANCE))
7075  {
7076  // Do Something
7077  }
7078  </code>
7079  Remarks:
7080  This feature may not be available on all devices. Please refer to the
7081  specific device data sheet to determine availability or use
7082  PLIB_USART_ExistsWakeOnStart in your application to determine
7083  whether this feature is available.
7084 */
7085 
7086 bool
7088  USART_MODULE_ID index ) ;
7089 //******************************************************************************
7090 /* Function:
7091  void PLIB_USART_InitializeModeGeneral( USART_MODULE_ID index, bool autobaud,
7092  bool loopBackMode, bool wakeFromSleep, bool irdaMode, bool stopInIdle );
7093  Summary:
7094  Enables or disables general features of the USART module.
7095  Description:
7096  This function enables or disables general features of the USART module.
7097  Precondition:
7098  None.
7099  Parameters:
7100  index - Identifier for the device instance to be configured
7101  autobaud - If true, auto baud rate detection is enabled. If false
7102  the feature is disabled.
7103  loopBackMode - If true, loop back is enabled. If false the feature is
7104  disabled.
7105  wakeFromSleep - If true, the USART module will wake up the CPU from sleep
7106  mode on USART activity. If false the feature is disabled.
7107  irdaMode - If true, the IrDA mode is enabled. If false the feature
7108  is disabled.
7109  stopInIdle - If true, module will stop functioning when CPU enters Idle
7110  mode. If false, the feature is disabled.
7111  Returns:
7112  None.
7113  Example:
7114  <code>
7115 #define MY_USART_INSTANCE USART_ID_1
7116  // Enable loopback, disable IrDA, disable auto baud detection and disable
7117  // wake from sleep. Enable stop in idle
7118  PLIB_USART_InitializeModeGeneral(MY_USART_INSTANCE, false, true,
7119  false, false, true);
7120  </code>
7121  Remarks:
7122  Enabling the wake from sleep feature will cause the first character that is
7123  received by the USART module to be discarded. This feature should only be
7124  enabled if the CPU is to placed in power saving mode.
7125 
7126  This feature may not be available on all devices. Please refer to the
7127  specific device data sheet to determine availability. Availability of this
7128  function can also be determined if all of the following functions return
7129  true:
7130  - PLIB_USART_ExistsLoopback
7131  - PLIB_USART_ExistsBaudRateAutoDetect
7132  - PLIB_USART_ExistsWakeOnStart
7133  - PLIB_USART_ExistsIrDA
7134  - PLIB_USART_ExistsStopInIdle
7135 */
7136 
7137 void
7139  USART_MODULE_ID index ,
7140  bool autobaud ,
7141  bool loopBackMode ,
7142  bool wakeFromSleep ,
7143  bool irdaMode ,
7144  bool stopInIdle ) ;
7145 //******************************************************************************
7146 /* Function:
7147  void PLIB_USART_InitializeOperation( USART_MODULE_ID index ,
7148  USART_RECEIVE_INTR_MODE receiveInterruptMode,
7149  USART_TRANSMIT_INTR_MODE transmitInterruptMode,
7150  USART_OPERATION_MODE operationMode);
7151  Summary:
7152  Configures the Receive and Transmit FIFO interrupt levels and the hardware
7153  lines to be used by the module.
7154  Description:
7155  This function configures the Receive and Transmit FIFO interrupt levels and
7156  the hardware lines to be used by the module.
7157  Precondition:
7158  None.
7159  Parameters:
7160  index - Identifier for the device instance to be configured
7161  receiveInterruptMode - Receiver FIFO interrupt level
7162  transmitInterruptMode - Transmit FIFO interrupt level
7163  operationMode - Hardware lines to be used by the USART.
7164  Returns:
7165  None.
7166  Example:
7167  <code>
7168 #define MY_USART_INSTANCE USART_ID_1
7169  // Set receive FIFO to interrupt when FIFO is 3/4 level full
7170  // Set Transmit FIFO to interrupt when FIFO is empty
7171  // USART module will only use RX and TX hardware lines
7172  PLIB_USART_InitializeOperation(MY_USART_INSTANCE, USART_RECEIVE_FIFO_3B4FULL,
7173  USART_TRANSMIT_FIFO_EMPTY , USART_ENABLE_TX_RX_USED);
7174  </code>
7175  Remarks:
7176  This feature may not be available on all devices. Please refer to the
7177  specific device data sheet to determine availability. Availability of this
7178  function can also be determined if all of the following functions return
7179  true:
7180  - PLIB_USART_ExistsReceiverInterruptMode
7181  - PLIB_USART_ExistsTransmitterInterruptMode
7182  - PLIB_USART_ExistsOperationMode
7183 */
7184 
7185 void
7187  USART_MODULE_ID index ,
7188  USART_RECEIVE_INTR_MODE receiveInterruptMode ,
7189  USART_TRANSMIT_INTR_MODE transmitInterruptMode ,
7190  USART_OPERATION_MODE operationMode ) ;
7191 //******************************************************************************
7192 /* Function:
7193  void PLIB_USART_BaudSetAndEnable ( USART_MODULE_ID index, uint32_t
7194  clockFrequency, uint32_t baudRate );
7195  Summary:
7196  Sets the baud rate to the desired value and enables the USART receiver,
7197  transmitter and the USART module.
7198  Description:
7199  This function sets the baud rate to the desired value and enables the USART
7200  receiver, USART transmitter and USART module.
7201  Precondition:
7202  None.
7203  Parameters:
7204  index - Identifier for the device instance to be configured
7205  baudRate - Baud Rate Value
7206  clockFrequency - Clock Frequency
7207  Returns:
7208  None.
7209  Example:
7210  <code>
7211 #define MY_USART_INSTANCE USART_ID_1
7212  uint32_t baudRateValue ;
7213  PLIB_USART_BaudSetAndEnable(MY_USART_INSTANCE, MY_CLOCK_FREQUENCY, 9600);
7214  </code>
7215  Remarks:
7216  Setting a new baud rate value causes the baud rate timer to reset.
7217  This ensures that the baud rate timer does not have to overflow before
7218  outputting the new baud rate.
7219 
7220  If the system clock is changed during an active receive operation, a
7221  receiver error or data loss may result. To avoid this issue verify that
7222  no receptions are in progress before changing the system clock.
7223 
7224  This feature may not be available on all devices. Please refer to the
7225  specific device data sheet to determine availability. Availability of this
7226  function can also be determined if all of the following functions return
7227  true:
7228  - PLIB_USART_ExistsBaudRate
7229  - PLIB_USART_ExistsTransmitterEnable
7230  - PLIB_USART_ExistsReceiverEnable
7231  - PLIB_USART_ExistsEnable
7232 */
7233 
7234 void
7236  USART_MODULE_ID index ,
7237  uint32_t systemClock ,
7238  uint32_t baud ) ;
7239 //******************************************************************************
7240 /* Function:
7241  USART_ERROR PLIB_USART_ErrorsGet ( USART_MODULE_ID index )
7242  Summary:
7243  Return the status of all errors in the specified USART module.
7244  Description:
7245  This function returns status of all errors in the specified USART module.
7246  The return value can be bitwise AND'ed with a USART_ERROR type to know the
7247  status of a specific error.
7248  This operation is atomic.
7249  Precondition:
7250  None.
7251  Parameters:
7252  index - Identifier for the device instance to be configured
7253  Returns:
7254  Returns a bitmap of USART error status.
7255  Example:
7256  <code>
7257 #define MY_USART_INSTANCE USART_ID_1
7258  USART_ERROR error;
7259  // Get the status of all errors.
7260  error = PLIB_USART_ErrorsGet(MY_USART_INSTANCE);
7261  // Check if parity error is active
7262  if(error & USART_ERROR_PARITY)
7263  {
7264  // Parity error is active.
7265  }
7266  else if(error & USART_ERROR_FRAMING)
7267  {
7268  // Framing error is active.
7269  }
7270  </code>
7271  Remarks:
7272  This feature may not be available on all devices. Please refer to the
7273  specific device data sheet to determine availability. Availability of this
7274  function can also be determined if all of the followings functions return
7275  true:
7276  - PLIB_USART_ExistsReceiverFramingErrorStatus
7277  - PLIB_USART_ExistsReceiverParityErrorStatus
7278  - PLIB_USART_ExistsReceiverOverrunStatus
7279 */
7280 
7281 USART_ERROR
7283  USART_MODULE_ID index ) ;
7284 //******************************************************************************
7285 /* Function:
7286  PLIB_USART_TransmitterAddressGet( USART_MODULE_ID index )
7287  Summary:
7288  Returns the address of the USART TX register
7289  Description:
7290  This function returns the address of the USART TX register.
7291  This operation is atomic.
7292  Preconditions:
7293  None.
7294  Parameters:
7295  index - Identifier for the device instance
7296  Returns:
7297  Address of the USART TX register
7298  Remarks:
7299  None.
7300 */
7301 
7302 void *
7304  USART_MODULE_ID index ) ;
7305 //******************************************************************************
7306 /* Function:
7307  PLIB_USART_ReceiverAddressGet( USART_MODULE_ID index )
7308  Summary:
7309  Returns the address of the USART RX register
7310  Description:
7311  This function returns the address of the USART RX register.
7312  This operation is atomic.
7313  Preconditions:
7314  None.
7315  Parameters:
7316  index - Identifier for the device instance
7317  Returns:
7318  Address of the USART RX register
7319  Remarks:
7320  None.
7321 */
7322 
7323 void *
7325  USART_MODULE_ID index ) ;
7326 // *****************************************************************************
7327 // *****************************************************************************
7328 // Section: USART Peripheral Library Exists Functions
7329 // *****************************************************************************
7330 // *****************************************************************************
7331 /* The following functions indicate the existence of the features on the device.
7332 */
7333 //******************************************************************************
7334 /* Function:
7335  PLIB_USART_ExistsRunInOverflow ( USART_MODULE_ID index )
7336  Summary:
7337  Identifies whether the Run in overflow condition feature exists on the USART module.
7338  Description:
7339  This function identifies whether the Run in Overflow condition feature is
7340  available on the USART module. When this function returns true, these
7341  functions are supported on the device:
7342  - PLIB_USART_RunInOverflowEnable
7343  - PLIB_USART_RunInOverflowDisable
7344  - PLIB_USART_RunInOverflowIsEnabled
7345  This operation is atomic.
7346  Preconditions:
7347  None.
7348  Parameters:
7349  index - Identifier for the device instance
7350  Returns:
7351  - true - The Run in Overflow condition feature is supported on the device
7352  - false - The Run in Overflow condition feature is not supported on the device
7353  Remarks:
7354  None.
7355 */
7356 
7357 bool
7359  USART_MODULE_ID index ) ;
7360 //******************************************************************************
7361 /* Function:
7362  PLIB_USART_ExistsBRGClockSourceSelect ( USART_MODULE_ID index )
7363  Summary:
7364  Identifies whether the BRG Clock source select feature exists on the
7365  USART module.
7366  Description:
7367  This function identifies whether the BRG Clock source select feature is
7368  available on the USART module. When this function returns true, these
7369  functions are supported on the device:
7370  - PLIB_USART_BRGClockSourceSelect
7371  - PLIB_USART_BRGClockSourceGet
7372  This operation is atomic.
7373  Preconditions:
7374  None.
7375  Parameters:
7376  index - Identifier for the device instance
7377  Returns:
7378  - true - The BRG clock source select feature is supported on the device
7379  - false - The BRG clock source select feature is not supported on the device
7380  Remarks:
7381  None.
7382 */
7383 
7384 bool
7386  USART_MODULE_ID index ) ;
7387 //******************************************************************************
7388 /* Function:
7389  PLIB_USART_ExistsModuleBusyStatus ( USART_MODULE_ID index )
7390  Summary:
7391  Identifies whether the module running status feature exists on the
7392  USART module.
7393  Description:
7394  This function identifies whether the module running status feature is
7395  available on the USART module. When this function returns true, this
7396  function is supported on the device:
7397  - PLIB_USART_ModuleIsBusy
7398  This operation is atomic.
7399  Preconditions:
7400  None.
7401  Parameters:
7402  index - Identifier for the device instance
7403  Returns:
7404  - true - The Module running status feature is supported on the device
7405  - false - The Module running status feature is not supported on the device
7406  Remarks:
7407  None.
7408 */
7409 
7410 bool
7412  USART_MODULE_ID index ) ;
7413 //******************************************************************************
7414 /* Function:
7415  PLIB_USART_ExistsRunInSleepMode ( USART_MODULE_ID index )
7416  Summary:
7417  Identifies whether the Run in Sleep mode feature exists on the USART module.
7418  Description:
7419  This function identifies whether the Run in Sleep mode feature is
7420  available on the USART module. When this function returns true, these
7421  functions are supported on the device:
7422  - PLIB_USART_RunInSleepModeEnable
7423  - PLIB_USART_RunInSleepModeDisable
7424  - PLIB_USART_RunInSleepModeIsEnabled
7425  This operation is atomic.
7426  Preconditions:
7427  None.
7428  Parameters:
7429  index - Identifier for the device instance
7430  Returns:
7431  - true - The Run in Sleep mode feature is supported on the device
7432  - false - The Run in Sleep mode feature is not supported on the device
7433  Remarks:
7434  None.
7435 */
7436 
7437 bool
7439  USART_MODULE_ID index ) ;
7440 //******************************************************************************
7441 /* Function:
7442  PLIB_USART_ExistsEnable( USART_MODULE_ID index )
7443  Summary:
7444  Identifies whether the EnableControl feature exists on the USART module.
7445  Description:
7446  This function identifies whether the EnableControl feature is
7447  available on the USART module. When this function returns true, these
7448  functions are supported on the device:
7449  - PLIB_USART_Disable
7450  - PLIB_USART_Enable
7451  This operation is atomic.
7452  Preconditions:
7453  None.
7454  Parameters:
7455  index - Identifier for the device instance
7456  Returns:
7457  - true - The EnableControl feature is supported on the device
7458  - false - The EnableControl feature is not supported on the device
7459  Remarks:
7460  None.
7461 */
7462 
7463 bool
7465  USART_MODULE_ID index ) ;
7466 //******************************************************************************
7467 /* Function:
7468  PLIB_USART_ExistsHandshakeMode( USART_MODULE_ID index )
7469  Summary:
7470  Identifies whether the HandShakeMode feature exists on the USART module.
7471  Description:
7472  This function identifies whether the HandShakeMode feature is
7473  available on the USART module. When this function returns true, this
7474  function is supported on the device:
7475  - PLIB_USART_HandshakeModeSelect
7476  This operation is atomic.
7477  Preconditions:
7478  None.
7479  Parameters:
7480  index - Identifier for the device instance
7481  Returns:
7482  - true - The HandShakeMode feature is supported on the device
7483  - false - The HandShakeMode feature is not supported on the device
7484  Remarks:
7485  None.
7486 */
7487 
7488 bool
7490  USART_MODULE_ID index ) ;
7491 //******************************************************************************
7492 /* Function:
7493  PLIB_USART_ExistsIrDA( USART_MODULE_ID index )
7494  Summary:
7495  Identifies whether the IrDAControl feature exists on the USART module.
7496  Description:
7497  This function identifies whether the IrDAControl feature is
7498  available on the USART module. When this function returns true, these
7499  functions are supported on the device:
7500  - PLIB_USART_IrDADisable
7501  - PLIB_USART_IrDAEnable
7502  This operation is atomic.
7503  Preconditions:
7504  None.
7505  Parameters:
7506  index - Identifier for the device instance
7507  Returns:
7508  - true - The IrDAControl feature is supported on the device
7509  - false - The IrDAControl feature is not supported on the device
7510  Remarks:
7511  None.
7512 */
7513 
7514 bool
7516  USART_MODULE_ID index ) ;
7517 //******************************************************************************
7518 /* Function:
7519  PLIB_USART_ExistsLineControlMode( USART_MODULE_ID index )
7520  Summary:
7521  Identifies whether the LineControlMode feature exists on the USART module.
7522  Description:
7523  This function identifies whether the LineControlMode feature is
7524  available on the USART module. When this function returns true, this
7525  function is supported on the device:
7526  - PLIB_USART_LineControlModeSelect
7527  This operation is atomic.
7528  Preconditions:
7529  None.
7530  Parameters:
7531  index - Identifier for the device instance
7532  Returns:
7533  - true - The LineControlMode feature is supported on the device
7534  - false - The LineControlMode feature is not supported on the device
7535  Remarks:
7536  None.
7537 */
7538 
7539 bool
7541  USART_MODULE_ID index ) ;
7542 //******************************************************************************
7543 /* Function:
7544  PLIB_USART_ExistsLoopback( USART_MODULE_ID index )
7545  Summary:
7546  Identifies whether the Loopback feature exists on the USART module.
7547  Description:
7548  This function identifies whether the Loopback feature is
7549  available on the USART module. When this function returns true, these
7550  functions are supported on the device:
7551  - PLIB_USART_LoopbackEnable
7552  - PLIB_USART_LoopbackDisable
7553  This operation is atomic.
7554  Preconditions:
7555  None.
7556  Parameters:
7557  index - Identifier for the device instance
7558  Returns:
7559  - true - The Loopback feature is supported on the device
7560  - false - The Loopback feature is not supported on the device
7561  Remarks:
7562  None.
7563 */
7564 
7565 bool
7567  USART_MODULE_ID index ) ;
7568 //******************************************************************************
7569 /* Function:
7570  PLIB_USART_ExistsOperationMode( USART_MODULE_ID index )
7571  Summary:
7572  Identifies whether the OperationMode feature exists on the USART module.
7573  Description:
7574  This function identifies whether the OperationMode feature is
7575  available on the USART module. When this function returns true, this
7576  function is supported on the device:
7577  - PLIB_USART_OperationModeSelect
7578  This operation is atomic.
7579  Preconditions:
7580  None.
7581  Parameters:
7582  index - Identifier for the device instance
7583  Returns:
7584  - true - The OperationMode feature is supported on the device
7585  - false - The OperationMode feature is not supported on the device
7586  Remarks:
7587  None.
7588 */
7589 
7590 bool
7592  USART_MODULE_ID index ) ;
7593 //******************************************************************************
7594 /* Function:
7595  PLIB_USART_ExistsStopInIdle( USART_MODULE_ID index )
7596  Summary:
7597  Identifies whether the StopInIdle feature exists on the USART module.
7598  Description:
7599  This function identifies whether the StopInIdle feature is
7600  available on the USART module. When this function returns true, these
7601  functions are supported on the device:
7602  - PLIB_USART_StopInIdleEnable
7603  - PLIB_USART_StopInIdleDisable
7604  This operation is atomic.
7605  Preconditions:
7606  None.
7607  Parameters:
7608  index - Identifier for the device instance
7609  Returns:
7610  - true - The StopInIdle feature is supported on the device
7611  - false - The StopInIdle feature is not supported on the device
7612  Remarks:
7613  None.
7614 */
7615 
7616 bool
7618  USART_MODULE_ID index ) ;
7619 //******************************************************************************
7620 /* Function:
7621  PLIB_USART_ExistsWakeOnStart( USART_MODULE_ID index )
7622  Summary:
7623  Identifies whether the WakeOnStart feature exists on the USART module.
7624  Description:
7625  This function identifies whether the WakeOnStart feature is
7626  available on the USART module. When this function returns true, these
7627  functions are supported on the device:
7628  - PLIB_USART_WakeOnStartEnable
7629  - PLIB_USART_WakeOnStartDisable
7630  - PLIB_USART_WakeOnStartIsEnabled
7631  This operation is atomic.
7632  Preconditions:
7633  None.
7634  Parameters:
7635  index - Identifier for the device instance
7636  Returns:
7637  - true - The WakeOnStart feature is supported on the device
7638  - false - The WakeOnStart feature is not supported on the device
7639  Remarks:
7640  None.
7641 */
7642 
7643 bool
7645  USART_MODULE_ID index ) ;
7646 //******************************************************************************
7647 /* Function:
7648  PLIB_USART_ExistsBaudRate( USART_MODULE_ID index )
7649  Summary:
7650  Identifies whether the BaudRate feature exists on the USART module.
7651  Description:
7652  This function identifies whether the BaudRate feature is
7653  available on the USART module. When this function returns true, these
7654  functions are supported on the device:
7655  - PLIB_USART_BaudRateSet
7656  - PLIB_USART_BaudRateGet
7657  This operation is atomic.
7658  Preconditions:
7659  None.
7660  Parameters:
7661  index - Identifier for the device instance
7662  Returns:
7663  - true - The BaudRate feature is supported on the device
7664  - false - The BaudRate feature is not supported on the device
7665  Remarks:
7666  None.
7667 */
7668 
7669 bool
7671  USART_MODULE_ID index ) ;
7672 //******************************************************************************
7673 /* Function:
7674  PLIB_USART_ExistsBaudRateAutoDetect( USART_MODULE_ID index )
7675  Summary:
7676  Identifies whether the BaudRateAutoDetect feature exists on the USART module.
7677  Description:
7678  This function identifies whether the BaudRateAutoDetect feature is
7679  available on the USART module. When this function returns true, these
7680  functions are supported on the device:
7681  - PLIB_USART_BaudRateAutoDetectEnable
7682  - PLIB_USART_BaudRateAutoDetectIsComplete
7683  This operation is atomic.
7684  Preconditions:
7685  None.
7686  Parameters:
7687  index - Identifier for the device instance
7688  Returns:
7689  - true - The BaudRateAutoDetect feature is supported on the device
7690  - false - The BaudRateAutoDetect feature is not supported on the device
7691  Remarks:
7692  None.
7693 */
7694 
7695 bool
7697  USART_MODULE_ID index ) ;
7698 //******************************************************************************
7699 /* Function:
7700  PLIB_USART_ExistsBaudRateHigh( USART_MODULE_ID index )
7701  Summary:
7702  Identifies whether the BaudRateHigh feature exists on the USART module.
7703  Description:
7704  This function identifies whether the BaudRateHigh feature is
7705  available on the USART module. When this function returns true, these
7706  functions are supported on the device:
7707  - PLIB_USART_BaudRateHighSet
7708  - PLIB_USART_BaudRateHighDisable
7709  - PLIB_USART_BaudRateHighEnable
7710  This operation is atomic.
7711  Preconditions:
7712  None.
7713  Parameters:
7714  index - Identifier for the device instance
7715  Returns:
7716  - true - The BaudRateHigh feature is supported on the device
7717  - false - The BaudRateHigh feature is not supported on the device
7718  Remarks:
7719  None.
7720 */
7721 
7722 bool
7724  USART_MODULE_ID index ) ;
7725 //******************************************************************************
7726 /* Function:
7727  PLIB_USART_ExistsReceiverAddress ( USART_MODULE_ID index )
7728  Summary:
7729  Identifies whether the Receiver Address feature exists on the USART
7730  module.
7731  Description:
7732  This function identifies whether the Receiver Address feature is
7733  available on the USART module. When this function returns true, these
7734  functions are supported on the device:
7735  - PLIB_USART_AddressSet
7736  - PLIB_USART_AddressGet
7737  This operation is atomic.
7738  Preconditions:
7739  None.
7740  Parameters:
7741  index - Identifier for the device instance
7742  Returns:
7743  - true - The Receiver address feature is supported on the device
7744  - false - The Receiver address feature is not supported on the device
7745  Remarks:
7746  None.
7747 */
7748 
7749 bool
7751  USART_MODULE_ID index ) ;
7752 //******************************************************************************
7753 /* Function:
7754  PLIB_USART_ExistsReceiverAddressMask ( USART_MODULE_ID index )
7755  Summary:
7756  Identifies whether the Receiver Address Mask feature exists on the USART
7757  module.
7758  Description:
7759  This function identifies whether the Receiver Address Mask feature is
7760  available on the USART module. When this function returns true, these
7761  functions are supported on the device:
7762  - PLIB_USART_AddressMaskSet
7763  - PLIB_USART_AddressMaskGet
7764  This operation is atomic.
7765  Preconditions:
7766  None.
7767  Parameters:
7768  index - Identifier for the device instance
7769  Returns:
7770  - true - The Receiver address mask feature is supported on the device
7771  - false - The Receiver address mask feature is not supported on the device
7772  Remarks:
7773  None.
7774 */
7775 
7776 bool
7778  USART_MODULE_ID index ) ;
7779 //******************************************************************************
7780 /* Function:
7781  PLIB_USART_ExistsReceiver( USART_MODULE_ID index )
7782  Summary:
7783  Identifies whether the Receiver feature exists on the USART module.
7784  Description:
7785  This function identifies whether the Receiver feature is available on the
7786  USART module. When this function returns true, these functions are supported
7787  on the device:
7788  - PLIB_USART_ReceiverByteReceive
7789  - PLIB_USART_ReceiverAddressGet
7790  This operation is atomic.
7791  Preconditions:
7792  None.
7793  Parameters:
7794  index - Identifier for the device instance
7795  Returns:
7796  - true - The Receiver feature is supported on the device
7797  - false - The Receiver feature is not supported on the device
7798  Remarks:
7799  None.
7800 */
7801 
7802 bool
7804  USART_MODULE_ID index ) ;
7805 //******************************************************************************
7806 /* Function:
7807  PLIB_USART_ExistsReceiver9Bits ( USART_MODULE_ID index )
7808  Summary:
7809  Identifies whether the 9 Bits Receiver feature exists on the USART module.
7810  Description:
7811  This function identifies whether the 9 Bits Receiver feature is available on the
7812  USART module. When this function returns true, this function is supported
7813  on the device:
7814  - PLIB_USART_Receiver9BitsReceive
7815  This operation is atomic.
7816  Preconditions:
7817  None.
7818  Parameters:
7819  index - Identifier for the device instance
7820  Returns:
7821  - true - The feature is supported on the device
7822  - false - The feature is not supported on the device
7823  Remarks:
7824  None.
7825 */
7826 
7827 bool
7829  USART_MODULE_ID index ) ;
7830 //******************************************************************************
7831 /* Function:
7832  PLIB_USART_ExistsReceiverAddressAutoDetect( USART_MODULE_ID index )
7833  Summary:
7834  Identifies whether the ReceiverAddressAutoDetect feature exists on the USART module.
7835  Description:
7836  This function identifies whether the ReceiverAddressAutoDetect feature is
7837  available on the USART module. When this function returns true, these
7838  functions are supported on the device:
7839  - PLIB_USART_ReceiverAddressAutoDetectEnable
7840  - PLIB_USART_ReceiverAddressAutoDetectDisable
7841  This operation is atomic.
7842  Preconditions:
7843  None.
7844  Parameters:
7845  index - Identifier for the device instance
7846  Returns:
7847  - true - The ReceiverAddressAutoDetect feature is supported on the device
7848  - false - The ReceiverAddressAutoDetect feature is not supported on the device
7849  Remarks:
7850  None.
7851 */
7852 
7853 bool
7855  USART_MODULE_ID index ) ;
7856 //******************************************************************************
7857 /* Function:
7858  PLIB_USART_ExistsReceiverAddressDetect( USART_MODULE_ID index )
7859  Summary:
7860  Identifies whether the ReceiverAddressDetect feature exists on the USART module.
7861  Description:
7862  This function identifies whether the ReceiverAddressDetect feature is
7863  available on the USART module. When this function returns true, these
7864  functions are supported on the device:
7865  - PLIB_USART_ReceiverAddressDetectEnable
7866  - PLIB_USART_ReceiverAddressDetectDisable
7867  - PLIB_USART_ReceiverAddressIsReceived
7868  This operation is atomic.
7869  Preconditions:
7870  None.
7871  Parameters:
7872  index - Identifier for the device instance
7873  Returns:
7874  - true - The ReceiverAddressDetect feature is supported on the device
7875  - false - The ReceiverAddressDetect feature is not supported on the device
7876  Remarks:
7877  None.
7878 */
7879 
7880 bool
7882  USART_MODULE_ID index ) ;
7883 //******************************************************************************
7884 /* Function:
7885  PLIB_USART_ExistsReceiverDataAvailableStatus( USART_MODULE_ID index )
7886  Summary:
7887  Identifies whether the ReceiverDataAvailable feature exists on the USART
7888  module
7889  Description:
7890  This function identifies whether the ReceiverDataAvailable feature is
7891  available on the USART module. When this function returns true, this
7892  function is supported on the device:
7893  - PLIB_USART_ReceiverDataIsAvailable
7894  This operation is atomic.
7895  Preconditions:
7896  None.
7897  Parameters:
7898  index - Identifier for the device instance
7899  Returns:
7900  - true - The ReceiverDataAvailable feature is supported on the device
7901  - false - The ReceiverDataAvailable feature is not supported on the device
7902  Remarks:
7903  None.
7904 */
7905 
7906 bool
7908  USART_MODULE_ID index ) ;
7909 //******************************************************************************
7910 /* Function:
7911  PLIB_USART_ExistsReceiverEnable( USART_MODULE_ID index )
7912  Summary:
7913  Identifies whether the ReceiverEnableControl feature exists on the USART module.
7914  Description:
7915  This function identifies whether the ReceiverEnableControl feature is
7916  available on the USART module. When this function returns true, these
7917  functions are supported on the device:
7918  - PLIB_USART_ReceiverEnable
7919  - PLIB_USART_ReceiverDisable
7920  This operation is atomic.
7921  Preconditions:
7922  None.
7923  Parameters:
7924  index - Identifier for the device instance
7925  Returns:
7926  - true - The ReceiverEnableControl feature is supported on the device
7927  - false - The ReceiverEnableControl feature is not supported on the device
7928  Remarks:
7929  None.
7930 */
7931 
7932 bool
7934  USART_MODULE_ID index ) ;
7935 //******************************************************************************
7936 /* Function:
7937  PLIB_USART_ExistsReceiverIdleStatus( USART_MODULE_ID index )
7938  Summary:
7939  Identifies whether the ReceiverIdle feature exists on the USART module.
7940  Description:
7941  This function identifies whether the ReceiverIdle feature is
7942  available on the USART module. When this function returns true, this
7943  function is supported on the device:
7944  - PLIB_USART_ReceiverIsIdle
7945  This operation is atomic.
7946  Preconditions:
7947  None.
7948  Parameters:
7949  index - Identifier for the device instance
7950  Returns:
7951  - true - The ReceiverIdle feature is supported on the device
7952  - false - The ReceiverIdle feature is not supported on the device
7953  Remarks:
7954  None.
7955 */
7956 
7957 bool
7959  USART_MODULE_ID index ) ;
7960 //******************************************************************************
7961 /* Function:
7962  PLIB_USART_ExistsReceiverFramingErrorStatus( USART_MODULE_ID index )
7963  Summary:
7964  Identifies whether the ReceiverFramingError feature exists on the USART module.
7965  Description:
7966  This function identifies whether the ReceiverFramingError feature is
7967  available on the USART module. When this function returns true, this
7968  function is supported on the device:
7969  - PLIB_USART_ReceiverFramingErrorHasOccurred
7970  This operation is atomic.
7971  Preconditions:
7972  None.
7973  Parameters:
7974  index - Identifier for the device instance
7975  Returns:
7976  - true - The ReceiverFramingError feature is supported on the device
7977  - false - The ReceiverFramingError feature is not supported on the device
7978  Remarks:
7979  None.
7980 */
7981 
7982 bool
7984  USART_MODULE_ID index ) ;
7985 //******************************************************************************
7986 /* Function:
7987  PLIB_USART_ExistsReceiverInterruptMode( USART_MODULE_ID index )
7988  Summary:
7989  Identifies whether the ReceiverInterruptMode feature exists on the USART module.
7990  Description:
7991  This function identifies whether the ReceiverInterruptMode feature is
7992  available on the USART module. When this function returns true, this
7993  function is supported on the device:
7994  - PLIB_USART_ReceiverInterruptModeSelect
7995  This operation is atomic.
7996  Preconditions:
7997  None.
7998  Parameters:
7999  index - Identifier for the device instance
8000  Returns:
8001  - true - The ReceiverInterruptMode feature is supported on the device
8002  - false - The ReceiverInterruptMode feature is not supported on the device
8003  Remarks:
8004  None.
8005 */
8006 
8007 bool
8009  USART_MODULE_ID index ) ;
8010 //******************************************************************************
8011 /* Function:
8012  PLIB_USART_ExistsReceiverIdleStateLowEnable( USART_MODULE_ID index )
8013  Summary:
8014  Identifies whether the ReceiverPolarityInvert feature exists on the USART module.
8015  Description:
8016  This function identifies whether the ReceiverPolarityInvert feature is
8017  available on the USART module. When this function returns true, these
8018  functions are supported on the device:
8019  - PLIB_USART_ReceiverIdleStateLowEnable
8020  - PLIB_USART_ReceiverIdleStateLowDisable
8021  This operation is atomic.
8022  Preconditions:
8023  None.
8024  Parameters:
8025  index - Identifier for the device instance
8026  Returns:
8027  - true - The ReceiverPolarityInvert feature is supported on the device
8028  - false - The ReceiverPolarityInvert feature is not supported on the device
8029  Remarks:
8030  None.
8031 */
8032 
8033 bool
8035  USART_MODULE_ID index ) ;
8036 //******************************************************************************
8037 /* Function:
8038  PLIB_USART_ExistsReceiverParityErrorStatus( USART_MODULE_ID index )
8039  Summary:
8040  Identifies whether the ReceiverParityError feature exists on the USART module.
8041  Description:
8042  This function identifies whether the ReceiverParityError feature is
8043  available on the USART module. When this function returns true, this
8044  function is supported on the device:
8045  - PLIB_USART_ReceiverParityErrorHasOccurred
8046  This operation is atomic.
8047  Preconditions:
8048  None.
8049  Parameters:
8050  index - Identifier for the device instance
8051  Returns:
8052  - true - The ReceiverParityError feature is supported on the device
8053  - false - The ReceiverParityError feature is not supported on the device
8054  Remarks:
8055  None.
8056 */
8057 
8058 bool
8060  USART_MODULE_ID index ) ;
8061 //******************************************************************************
8062 /* Function:
8063  PLIB_USART_ExistsReceiverOverrunStatus( USART_MODULE_ID index )
8064  Summary:
8065  Identifies whether the ReceiverOverrunError feature exists on the USART module.
8066  Description:
8067  This function identifies whether the ReceiverOverrunError feature is
8068  available on the USART module. When this function returns true, these
8069  functions are supported on the device:
8070  - PLIB_USART_ReceiverOverrunErrorClear
8071  - PLIB_USART_ReceiverOverrunHasOccurred
8072  This operation is atomic.
8073  Preconditions:
8074  None.
8075  Parameters:
8076  index - Identifier for the device instance
8077  Returns:
8078  - true - The ReceiverOverrunError feature is supported on the device
8079  - false - The ReceiverOverrunError feature is not supported on the device
8080  Remarks:
8081  None.
8082 */
8083 
8084 bool
8086  USART_MODULE_ID index ) ;
8087 //******************************************************************************
8088 /* Function:
8089  PLIB_USART_ExistsTransmitter( USART_MODULE_ID index )
8090  Summary:
8091  Identifies whether the Transmitter feature exists on the USART module.
8092  Description:
8093  This function identifies whether the Transmitter feature is
8094  available on the USART module. When this function returns true, these
8095  functions are supported on the device:
8096  - PLIB_USART_TransmitterByteSend
8097  - PLIB_USART_TransmitterAddressGet
8098  This operation is atomic.
8099  Preconditions:
8100  None.
8101  Parameters:
8102  index - Identifier for the device instance
8103  Returns:
8104  - true - The Transmitter feature is supported on the device
8105  - false - The Transmitter feature is not supported on the device
8106  Remarks:
8107  None.
8108 */
8109 
8110 bool
8112  USART_MODULE_ID index ) ;
8113 //******************************************************************************
8114 /* Function:
8115  PLIB_USART_ExistsTransmitter9BitsSend( USART_MODULE_ID index )
8116  Summary:
8117  Identifies whether the Transmitter9Bits feature exists on the USART module.
8118  Description:
8119  This function identifies whether the Transmitter9Bits feature is
8120  available on the USART module. When this function returns true, this
8121  function is supported on the device:
8122  - PLIB_USART_Transmitter9BitsSend
8123  This operation is atomic.
8124  Preconditions:
8125  None.
8126  Parameters:
8127  index - Identifier for the device instance
8128  Returns:
8129  - true - The Transmitter9Bits feature is supported on the device
8130  - false - The Transmitter9Bits feature is not supported on the device
8131  Remarks:
8132  None.
8133 */
8134 
8135 bool
8137  USART_MODULE_ID index ) ;
8138 //******************************************************************************
8139 /* Function:
8140  PLIB_USART_ExistsTransmitterBreak( USART_MODULE_ID index )
8141  Summary:
8142  Identifies whether the TransmitterBreak feature exists on the USART module.
8143  Description:
8144  This function identifies whether the TransmitterBreak feature is
8145  available on the USART module. When this function returns true, these
8146  functions are supported on the device:
8147  - PLIB_USART_TransmitterBreakSend
8148  - PLIB_USART_TransmitterBreakSendIsComplete
8149  This operation is atomic.
8150  Preconditions:
8151  None.
8152  Parameters:
8153  index - Identifier for the device instance
8154  Returns:
8155  - true - The TransmitterBreak feature is supported on the device
8156  - false - The TransmitterBreak feature is not supported on the device
8157  Remarks:
8158  None.
8159 */
8160 
8161 bool
8163  USART_MODULE_ID index ) ;
8164 //******************************************************************************
8165 /* Function:
8166  PLIB_USART_ExistsTransmitterBufferFullStatus( USART_MODULE_ID index )
8167  Summary:
8168  Identifies whether the TransmitterBufferFull feature exists on the USART module.
8169  Description:
8170  This function identifies whether the TransmitterBufferFull feature is
8171  available on the USART module. When this function returns true, this
8172  function is supported on the device:
8173  - PLIB_USART_TransmitterBufferIsFull
8174  This operation is atomic.
8175  Preconditions:
8176  None.
8177  Parameters:
8178  index - Identifier for the device instance
8179  Returns:
8180  - true - The TransmitterBufferFull feature is supported on the device
8181  - false - The TransmitterBufferFull feature is not supported on the device
8182  Remarks:
8183  None.
8184 */
8185 
8186 bool
8188  USART_MODULE_ID index ) ;
8189 //******************************************************************************
8190 /* Function:
8191  PLIB_USART_ExistsTransmitterEmptyStatus( USART_MODULE_ID index )
8192  Summary:
8193  Identifies whether the TransmitterEmpty feature exists on the USART module.
8194  Description:
8195  This function identifies whether the TransmitterEmpty feature is
8196  available on the USART module. When this function returns true, this
8197  function is supported on the device:
8198  - PLIB_USART_TransmitterIsEmpty
8199  This operation is atomic.
8200  Preconditions:
8201  None.
8202  Parameters:
8203  index - Identifier for the device instance
8204  Returns:
8205  - true - The TransmitterEmpty feature is supported on the device
8206  - false - The TransmitterEmpty feature is not supported on the device
8207  Remarks:
8208  None.
8209 */
8210 
8211 bool
8213  USART_MODULE_ID index ) ;
8214 //******************************************************************************
8215 /* Function:
8216  PLIB_USART_ExistsTransmitterEnable( USART_MODULE_ID index )
8217  Summary:
8218  Identifies whether the TransmitterEnableControl feature exists on the USART
8219  module
8220  Description:
8221  This function identifies whether the TransmitterEnableControl feature is
8222  available on the USART module. When this function returns true, these
8223  functions are supported on the device:
8224  - PLIB_USART_TransmitterEnable
8225  - PLIB_USART_TransmitterDisable
8226  This operation is atomic.
8227  Preconditions:
8228  None.
8229  Parameters:
8230  index - Identifier for the device instance
8231  Returns:
8232  - true - The TransmitterEnableControl feature is supported on the device
8233  - false - The TransmitterEnableControl feature is not supported on the device
8234  Remarks:
8235  None.
8236 */
8237 
8238 bool
8240  USART_MODULE_ID index ) ;
8241 //******************************************************************************
8242 /* Function:
8243  PLIB_USART_ExistsTransmitterInterruptMode( USART_MODULE_ID index )
8244  Summary:
8245  Identifies whether the TransmitterInterruptMode feature exists on the USART module.
8246  Description:
8247  This function identifies whether the TransmitterInterruptMode feature is
8248  available on the USART module. When this function returns true, this function
8249  is supported on the device:
8250  - PLIB_USART_TransmitterInterruptModeSelect
8251  This operation is atomic.
8252  Preconditions:
8253  None.
8254  Parameters:
8255  index - Identifier for the device instance
8256  Returns:
8257  - true - The TransmitterInterruptMode feature is supported on the device
8258  - false - The TransmitterInterruptMode feature is not supported on the device
8259  Remarks:
8260  None.
8261 */
8262 
8263 bool
8265  USART_MODULE_ID index ) ;
8266 //******************************************************************************
8267 /* Function:
8268  PLIB_USART_ExistsTransmitterIdleIsLow( USART_MODULE_ID index )
8269  Summary:
8270  Identifies whether the TransmitterIdleIsLow feature exists on the USART module.
8271  Description:
8272  This function identifies whether the TransmitterIdleIsLow feature is available
8273  on the USART module. When this function returns true, these functions are
8274  supported on the device:
8275  - PLIB_USART_TransmitterIdleIsLowDisable
8276  - PLIB_USART_TransmitterIdleIsLowEnable
8277  This operation is atomic.
8278  Preconditions:
8279  None.
8280  Parameters:
8281  index - Identifier for the device instance
8282  Returns:
8283  - true - The TransmitterIdleIsLow feature is supported on the device
8284  - false - The TransmitterIdleIsLow feature is not supported on the device
8285  Remarks:
8286  None.
8287 */
8288 
8289 bool
8291  USART_MODULE_ID index ) ;
8292 //DOM-IGNORE-BEGIN
8293 //DOM-IGNORE-END
8294  // #ifndef _PLIB_USART_H
8295 /******************************************************************************
8296  End of File
8297 */
8298 
8299 #endif /*00 C:\microchip\harmony\v2_06\framework\peripheral\usart\plib_usart.h*/
8300 /* CLOSE_FILE Include File */
8301 
8302 /* OPEN FILE C:\microchip\harmony\v2_06\framework\system\system.h */
8303 /*******************************************************************************
8304  System Services Library Interface Header
8305  Company:
8306  Microchip Technology Inc.
8307  File Name:
8308  system.h
8309  Summary:
8310  Top level common system services library interface header.
8311  Description:
8312  This file is the top level common system services library interface header.
8313  It defines (or includes files that define) the common system service
8314  types, prototypes, and other definitions that are commonly used by MPLAB
8315  Harmony libraries and system services.
8316 
8317  System services provide common functionality that would otherwise need to
8318  be duplicated by multiple other modules or that would force them to
8319  interact in complex and hard to manage ways. System services eliminate
8320  conflicts by controlling access shared resources.
8321  Remarks:
8322  The parent directory to the "system" directory should be added to the
8323  compiler's search path for header files such that the following include
8324  statment will successfully include this file.
8325 
8326 #include "system/system.h"
8327  *******************************************************************************/
8328 //DOM-IGNORE-BEGIN
8329 /*******************************************************************************
8330 Copyright (c) 2011-2015 released Microchip Technology Inc. All rights reserved.
8331 Microchip licenses to you the right to use, modify, copy and distribute
8332 Software only when embedded on a Microchip microcontroller or digital signal
8333 controller that is integrated into your product or third party product
8334 (pursuant to the sublicense terms in the accompanying license agreement).
8335 You should refer to the license agreement accompanying this Software for
8336 additional information regarding your rights and obligations.
8337 SOFTWARE AND DOCUMENTATION ARE PROVIDED 'AS IS' WITHOUT WARRANTY OF ANY KIND,
8338 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
8339 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
8340 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
8341 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
8342 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
8343 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
8344 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
8345 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
8346 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
8347  *******************************************************************************/
8348 //DOM-IGNORE-END
8349 #ifndef _SYSTEM_H
8350 #define _SYSTEM_H
8351 // *****************************************************************************
8352 // *****************************************************************************
8353 // Section: Included Files
8354 // *****************************************************************************
8355 // *****************************************************************************
8356 #include "system/common/sys_common.h"
8357 #include "system/common/sys_module.h"
8358 // DOM-IGNORE-BEGIN
8359 // DOM-IGNORE-END
8360 //DOM-IGNORE-BEGIN
8361 //DOM-IGNORE-END
8362  // _SYSTEM_H
8363 /*******************************************************************************
8364  End of File
8365 */
8366 #endif /*00 C:\microchip\harmony\v2_06\framework\system\system.h*/
8367 /* CLOSE_FILE Include File */
8368 
8369 #include "system/int/sys_int.h"
8370 /* OPEN FILE C:\microchip\harmony\v2_06\framework\system\dma\sys_dma.h */
8371 /*******************************************************************************
8372  DMA System Service Library Interface Definition
8373  Company:
8374  Microchip Technology Inc.
8375  File Name:
8376  sys_dma.h
8377  Summary:
8378  DMA System Service.
8379  Description:
8380  This file contains the interface definition for the DMA System
8381  Service. It provides a way to interact with the DMA subsystem to
8382  manage the data transfer between different peripherals and/or memory
8383  without intervention from the CPU.
8384 *******************************************************************************/
8385 //DOM-IGNORE-BEGIN
8386 /*******************************************************************************
8387 Copyright (c) 2013-2015 released Microchip Technology Inc. All rights reserved.
8388 Microchip licenses to you the right to use, modify, copy and distribute
8389 Software only when embedded on a Microchip microcontroller or digital signal
8390 controller that is integrated into your product or third party product
8391 (pursuant to the sublicense terms in the accompanying license agreement).
8392 You should refer to the license agreement accompanying this Software for
8393 additional information regarding your rights and obligations.
8394 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
8395 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
8396 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
8397 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
8398 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
8399 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
8400 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
8401 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
8402 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
8403 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
8404 *******************************************************************************/
8405 //DOM-IGNORE-END
8406 #ifndef _SYS_DMA_H
8407 #define _SYS_DMA_H
8408 /* OPEN FILE C:\microchip\harmony\v2_06\framework\system\dma\sys_dma_definitions.h */
8409 /*******************************************************************************
8410  DMA System Service Library Interface Definition
8411  Company:
8412  Microchip Technology Inc.
8413  File Name:
8414  sys_dma_definitions.h
8415  Summary:
8416  DMA System Service data type definitions header.
8417  Description:
8418  This file contains data type definitions header.
8419 *******************************************************************************/
8420 //DOM-IGNORE-BEGIN
8421 /*******************************************************************************
8422 Copyright (c) 2013-2015 released Microchip Technology Inc. All rights reserved.
8423 Microchip licenses to you the right to use, modify, copy and distribute
8424 Software only when embedded on a Microchip microcontroller or digital signal
8425 controller that is integrated into your product or third party product
8426 (pursuant to the sublicense terms in the accompanying license agreement).
8427 You should refer to the license agreement accompanying this Software for
8428 additional information regarding your rights and obligations.
8429 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
8430 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
8431 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
8432 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
8433 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
8434 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
8435 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
8436 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
8437 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
8438 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
8439 *******************************************************************************/
8440 //DOM-IGNORE-END
8441 #ifndef _SYS_DMA_DEFINITIONS_H
8442 #define _SYS_DMA_DEFINITIONS_H
8443 // *****************************************************************************
8444 // *****************************************************************************
8445 // Section: File includes
8446 // *****************************************************************************
8447 // *****************************************************************************
8448 #include "C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\system_config.h" /* LDRA full path */
8449 #include "system/common/sys_common.h"
8450 #include "system/common/sys_module.h"
8451 /* OPEN FILE C:\microchip\harmony\v2_06\framework\peripheral\dma\plib_dma.h */
8452 /*******************************************************************************
8453  DMA Peripheral Library Interface Header
8454  Company:
8455  Microchip Technology Inc.
8456  File Name:
8457  plib_dma.h
8458  Summary:
8459  Defines the DMA Peripheral Library interface functions.
8460  Description:
8461  This header file contains the function prototypes and definitions of
8462  the data types and constants that make up the interface to the Direct Memory
8463  Access (DMA) Peripheral Library for Microchip microcontrollers. The
8464  definitions in this file are for the DMA module.
8465 *******************************************************************************/
8466 // DOM-IGNORE-BEGIN
8467 /*******************************************************************************
8468 Copyright 2013-2015 released Microchip Technology Inc. All rights reserved.
8469 Microchip licenses to you the right to use, modify, copy and distribute
8470 Software only when embedded on a Microchip microcontroller or digital signal
8471 controller that is integrated into your product or third party product
8472 (pursuant to the sublicense terms in the accompanying license agreement).
8473 You should refer to the license agreement accompanying this Software for
8474 additional information regarding your rights and obligations.
8475 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
8476 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
8477 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
8478 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
8479 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
8480 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
8481 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
8482 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
8483 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
8484 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
8485 *******************************************************************************/
8486 // DOM-IGNORE-END
8487 #ifndef _PLIB_DMA_H
8488 #define _PLIB_DMA_H
8489 // DOM-IGNORE-BEGIN
8490 // DOM-IGNORE-END
8491 // *****************************************************************************
8492 // *****************************************************************************
8493 // Section: Includes
8494 // *****************************************************************************
8495 // *****************************************************************************
8496 /* See Bottom of file for implementation header include files.
8497 */
8498 /* OPEN FILE C:\microchip\harmony\v2_06\framework\peripheral\dma\processor\dma_processor.h */
8499 //DOM-IGNORE-BEGIN
8500 /*******************************************************************************
8501 Copyright (c) 2011-2016 released Microchip Technology Inc. All rights reserved.
8502 Microchip licenses to you the right to use, modify, copy and distribute
8503 Software only when embedded on a Microchip microcontroller or digital signal
8504 controller that is integrated into your product or third party product
8505 (pursuant to the sublicense terms in the accompanying license agreement).
8506 You should refer to the license agreement accompanying this Software for
8507 additional information regarding your rights and obligations.
8508 SOFTWARE AND DOCUMENTATION ARE PROVIDED 'AS IS' WITHOUT WARRANTY OF ANY KIND,
8509 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
8510 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
8511 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
8512 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
8513 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
8514 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
8515 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
8516 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
8517 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
8518  *******************************************************************************/
8519 //DOM-IGNORE-END
8520 #ifndef _PLIB_DMA_PROCESSOR_H
8521 #define _PLIB_DMA_PROCESSOR_H
8522 #error "Can't find header"
8523 #endif /*00 C:\microchip\harmony\v2_06\framework\peripheral\dma\processor\dma_processor.h*/
8524 /* CLOSE_FILE Include File */
8525 
8526 // *****************************************************************************
8527 // *****************************************************************************
8528 // Section: Peripheral Library Interface Functions
8529 // *****************************************************************************
8530 // *****************************************************************************
8531 // *****************************************************************************
8532 // *****************************************************************************
8533 // Section: DMA Channel Status Functions
8534 // *****************************************************************************
8535 // *****************************************************************************
8536 //******************************************************************************
8537 /* Function:
8538  bool PLIB_DMA_ChannelXBufferedDataIsWritten ( DMA_MODULE_ID index,
8539  DMA_CHANNEL channel )
8540  Summary:
8541  Returns the buffered data write status for the specified channel.
8542  Description:
8543  This function returns the buffered data write status for the specified channel.
8544  Precondition:
8545  None.
8546  Parameters:
8547  channel - One of the existing DMA channels listed by DMA_CHANNEL
8548  Returns:
8549  - true - The content of the DMA buffer has not been written to the location
8550  specified in the destination/source address or in Null Write mode
8551  - false - The content of the DMA buffer has been written to the location
8552  specified in the destination/source address or in Null Write mode
8553  Example:
8554  <code>
8555  bool chBuffWriteStatus;
8556  chBuffWriteStatus = PLIB_DMA_ChannelXBufferedDataIsWritten( DMA_ID_0,
8557  DMA_CHANNEL_3 );
8558  </code>
8559  Remarks:
8560  This feature is not available on all devices. Please refer to the specific device
8561  data sheet to determine availability.
8562 */
8563 
8564 bool
8566  DMA_MODULE_ID index ,
8567  DMA_CHANNEL channel ) ;
8568 /*******************************************************************************
8569  Function:
8570  bool PLIB_DMA_ChannelXCollisionStatus ( DMA_MODULE_ID index,
8571  DMA_CHANNEL channel,
8572  DMA_CHANNEL_COLLISION collisonType )
8573  Summary:
8574  Returns the status of the specified collision type for the specified channel.
8575  Description:
8576  This function returns the status of the specified collision type for the
8577  specified channel.
8578  Precondition:
8579  None.
8580  Parameters:
8581  channel - One of the existing DMA channels listed by DMA_CHANNEL
8582  collisonType - Collision type listed by DMA_CHANNEL_COLLISION
8583  Returns:
8584  - true - A collision specified by collisonType was detected
8585  - false - No collision of type collisonType was detected
8586  Example:
8587  <code>
8588  bool memWriteCollisionStatus;
8589  memWriteCollisionStatus = PLIB_DMA_ChannelXMemoryWriteCollisionStatus(
8590  DMA_ID_0,
8591  DMA_CHANNEL_3,
8592  DMA_CHANNEL_COLLISION_MEMORY );
8593  </code>
8594  Remarks:
8595  This feature is not available on all devices. Please refer to the specific
8596  device data sheet to determine availability.
8597 */
8598 
8599 bool
8601  DMA_MODULE_ID index ,
8602  DMA_CHANNEL channel ,
8603  DMA_CHANNEL_COLLISION collisonType ) ;
8604 //******************************************************************************
8605 /* Function:
8606  DMA_PING_PONG_MODE PLIB_DMA_ChannelXPingPongModeGet( DMA_MODULE_ID index,
8607  DMA_CHANNEL channel )
8608  Summary:
8609  Returns the Ping-Pong mode status for the specified channel.
8610  Description:
8611  This function returns the Ping-Pong mode status for the specified channel.
8612  Precondition:
8613  None.
8614  Parameters:
8615  channel - One of the existing DMA channels listed by DMA_CHANNEL
8616  Returns:
8617  mode - One of the possible Ping-Pong modes
8618  Example:
8619  <code>
8620  DMA_PING_PONG_MODE chPingPongStatus;
8621  chPingPongStatus = PLIB_DMA_ChannelXPingPongModeGet(DMA_ID_0,
8622  DMA_CHANNEL_3 );
8623  if (DMA_PING_PONG_SECONDARY == chPingPongStatus)
8624  {
8625  \\Application
8626  }
8627  </code>
8628  Remarks:
8629  This feature is not available on all devices. Please refer to the specific
8630  device data sheet to determine availability.
8631 */
8632 
8633 DMA_PING_PONG_MODE
8635  DMA_MODULE_ID index ,
8636  DMA_CHANNEL channel ) ;
8637 //******************************************************************************
8638 /* Function:
8639  bool PLIB_DMA_ChannelXEventIsDetected ( DMA_MODULE_ID index,
8640  DMA_CHANNEL channel )
8641  Summary:
8642  Returns the event status on the specified channel.
8643  Description:
8644  This function returns the event status on the specified channel.
8645  Precondition:
8646  None.
8647  Parameters:
8648  channel - One of the possible DMA channels listed by DMA_CHANNEL
8649  Returns:
8650  - true - An event was detected
8651  - false - No events were detected
8652  Example:
8653  <code>
8654  bool channeleventStatus;
8655  channeleventStatus = PLIB_DMA_ChannelXEventIsDetected( DMA_ID_0,
8656  DMA_CHANNEL_2 );
8657  </code>
8658  Remarks:
8659  This function implements an operation of the ChannelXEvent feature.
8660  This feature may not be available on all devices. Please refer to the
8661  specific device data sheet to determine availability or include the
8662  PLIB_DMA_ExistsChannelXEvent function in your application to determine
8663  whether this feature is available.
8664 */
8665 
8666 bool
8668  DMA_MODULE_ID index ,
8669  DMA_CHANNEL channel ) ;
8670 // *****************************************************************************
8671 // *****************************************************************************
8672 // Section: DMA Channel Configuration Functions
8673 // *****************************************************************************
8674 // *****************************************************************************
8675 //******************************************************************************
8676 /* Function:
8677  void PLIB_DMA_ChannelXPrioritySelect ( DMA_MODULE_ID index,
8678  DMA_CHANNEL channel,
8679  DMA_CHANNEL_PRIORITY channelPriority )
8680  Summary:
8681  Sets the priority of the specified channel.
8682  Description:
8683  This function sets the priority of the specified channel.
8684  Precondition:
8685  None.
8686  Parameters:
8687  channel - One of the existing DMA channels listed by DMA_CHANNEL
8688  channelPriority - One of the supported priorities listed by DMA_CHANNEL_PRIORITY
8689  Returns:
8690  None.
8691  Example:
8692  <code>
8693  DMA_CHANNEL channel = DMA_CHANNEL_0;
8694  DMA_CHANNEL_PRIORITY channelPriority = DMA_CHANNEL_PRIORITY_3;
8695  PLIB_DMA_ChannelXPrioritySelect( DMA_ID_0, channel, channelPriority );
8696  </code>
8697  Remarks:
8698  This function implements an operation of the ChannelXPriority feature.
8699  This feature may not be available on all devices. Please refer to the
8700  specific device data sheet to determine availability or use the
8701  PLIB_DMA_ExistsChannelXPriority function in your application to determine
8702  whether this feature is available.
8703 */
8704 
8705 void
8707  DMA_MODULE_ID index ,
8708  DMA_CHANNEL channel ,
8709  DMA_CHANNEL_PRIORITY channelPriority ) ;
8710 //******************************************************************************
8711 /* Function:
8712  DMA_CHANNEL_PRIORITY PLIB_DMA_ChannelXPriorityGet ( DMA_MODULE_ID index,
8713  DMA_CHANNEL channel )
8714  Summary:
8715  Gets the priority of the specified channel.
8716  Description:
8717  This function gets the priority of the specified channel.
8718  Precondition:
8719  None.
8720  Parameters:
8721  channel - One of the existing DMA channels listed by DMA_CHANNEL
8722  Returns:
8723  - channelPriority - One of the supported priorities listed by DMA_CHANNEL_PRIORITY
8724  Example:
8725  <code>
8726  DMA_CHANNEL channel = DMA_CHANNEL_0;
8727  DMA_CHANNEL_PRIORITY channelPriority;
8728  channelPriority = PLIB_DMA_ChannelXPriorityGet( DMA_ID_0, channel );
8729  </code>
8730  Remarks:
8731  This function implements an operation of the ChannelXPriority feature.
8732  This feature may not be available on all devices. Please refer to the
8733  specific device data sheet to determine availability or use the
8734  PLIB_DMA_ExistsChannelXPriority function in your application to determine
8735  whether this feature is available.
8736 */
8737 
8738 DMA_CHANNEL_PRIORITY
8740  DMA_MODULE_ID index ,
8741  DMA_CHANNEL channel ) ;
8742 //******************************************************************************
8743 /* Function:
8744  void PLIB_DMA_ChannelPrioritySelect ( DMA_MODULE_ID index,
8745  DMA_CHANNEL_PRIORITY channelPriority )
8746  Summary:
8747  Sets the priority scheme of the DMA channels.
8748  Description:
8749  This function sets the priority scheme of the DMA channels at the global level.
8750  This function is used in devices that do not have the per channel priority feature.
8751  Precondition:
8752  None.
8753  Parameters:
8754  channelPriority - One of the supported priorities listed by DMA_CHANNEL_PRIORITY
8755  Returns:
8756  None.
8757  Example:
8758  <code>
8759  DMA_CHANNEL_PRIORITY channelPriority = DMA_CHANNEL_ROUND_ROBIN;
8760  PLIB_DMA_ChannelPrioritySelect( DMA_ID_0, channelPriority );
8761  </code>
8762  Remarks:
8763  This feature is not available on all devices. Please refer to the specific
8764  device data sheet to determine availability.
8765 */
8766 
8767 void
8769  DMA_MODULE_ID index ,
8770  DMA_CHANNEL_PRIORITY channelPriority ) ;
8771 //******************************************************************************
8772 /* Function:
8773  DMA_CHANNEL_PRIORITY PLIB_DMA_ChannelPriorityGet ( DMA_MODULE_ID index )
8774  Summary:
8775  Gets the priority scheme of the DMA channels.
8776  Description:
8777  This function gets the priority scheme of the DMA channels at the global level.
8778  This function is used in devices that do not have the per channel priority feature.
8779  Precondition:
8780  None.
8781  Parameters:
8782  None.
8783  Returns:
8784  - channelPriority - One of the supported priorities listed by DMA_CHANNEL_PRIORITY
8785  Example:
8786  <code>
8787  DMA_CHANNEL_PRIORITY channelPriority;
8788  channelPriority = PLIB_DMA_ChannelPriorityGet( DMA_ID_0 );
8789  </code>
8790  Remarks:
8791  This feature is not available on all devices. Please refer to the specific
8792  device data sheet to determine availability.
8793 */
8794 
8795 DMA_CHANNEL_PRIORITY
8797  DMA_MODULE_ID index ) ;
8798 //******************************************************************************
8799 /* Function:
8800  void PLIB_DMA_ChannelXAutoEnable ( DMA_MODULE_ID index,
8801  DMA_CHANNEL channel )
8802  Summary:
8803  Channel is continuously enabled.
8804  Description:
8805  This function enables the channel continuously. The channel is not automatically
8806  disabled after a block transfer is complete.
8807  Precondition:
8808  None.
8809  Parameters:
8810  channel - One of the possible DMA channels listed by DMA_CHANNEL
8811  Returns:
8812  None.
8813  Example:
8814  <code>
8815  PLIB_DMA_ChannelXAutoEnable( DMA_ID_0, DMA_CHANNEL_2 );
8816  </code>
8817  Remarks:
8818  This function implements an operation of the ChannelXAuto feature.
8819  This feature may not be available on all devices. Please refer to the
8820  specific device data sheet to determine availability or use the
8821  PLIB_DMA_ExistsChannelXAuto function in your application to determine
8822  whether this feature is available.
8823 */
8824 
8825 void
8827  DMA_MODULE_ID index ,
8828  DMA_CHANNEL channel ) ;
8829 //******************************************************************************
8830 /* Function:
8831  bool PLIB_DMA_ChannelXAutoIsEnabled ( DMA_MODULE_ID index,
8832  DMA_CHANNEL channel )
8833  Summary:
8834  Returns the channel automatic enable status.
8835  Description:
8836  This function returns the channel automatic enable status.
8837  Precondition:
8838  None.
8839  Parameters:
8840  channel - One of the possible DMA channels listed by DMA_CHANNEL
8841  Returns:
8842  - true - Channel automatic enable is on
8843  - false - Channel automatic enable is off
8844  Example:
8845  <code>
8846  bool ChAutoEnableStatus;
8847  ChAutoEnableStatus = PLIB_DMA_ChannelXAutoIsEnabled(DMA_ID_0, DMA_CHANNEL_2 );
8848  </code>
8849  Remarks:
8850  This function implements an operation of the ChannelXAuto feature.
8851  This feature may not be available on all devices. Please refer to the
8852  specific device data sheet to determine availability or use the
8853  PLIB_DMA_ExistsChannelXAuto function in your application to determine
8854  whether this feature is available.
8855 */
8856 
8857 bool
8859  DMA_MODULE_ID index ,
8860  DMA_CHANNEL channel ) ;
8861 //******************************************************************************
8862 /* Function:
8863  void PLIB_DMA_ChannelXAutoDisable ( DMA_MODULE_ID index,
8864  DMA_CHANNEL channel )
8865  Summary:
8866  Channel is disabled after a block transfer is complete.
8867  Description:
8868  This function disables a channel after a block transfer is complete.
8869  Precondition:
8870  None.
8871  Parameters:
8872  channel - One of the possible DMA channels listed by DMA_CHANNEL
8873  Returns:
8874  None.
8875  Example:
8876  <code>
8877  PLIB_DMA_ChannelXAutoDisable( DMA_ID_0, DMA_CHANNEL_2 );
8878  </code>
8879  Remarks:
8880  This function implements an operation of the ChannelXAuto feature.
8881  This feature may not be available on all devices. Please refer to the
8882  specific device data sheet to determine availability or use the
8883  PLIB_DMA_ExistsChannelXAuto function in your application to determine
8884  whether this feature is available.
8885 */
8886 
8887 void
8889  DMA_MODULE_ID index ,
8890  DMA_CHANNEL channel ) ;
8891 //******************************************************************************
8892 /* Function:
8893  void PLIB_DMA_ChannelXChainEnable ( DMA_MODULE_ID index,
8894  DMA_CHANNEL channel )
8895  Summary:
8896  Channel chain feature is enabled.
8897  Description:
8898  This function enables the channel chain feature.
8899  Precondition:
8900  None.
8901  Parameters:
8902  channel - One of the possible DMA channels listed by DMA_CHANNEL
8903  Returns:
8904  None.
8905  Example:
8906  <code>
8907  PLIB_DMA_ChannelXChainEnable( DMA_ID_0, DMA_CHANNEL_2 );
8908  </code>
8909  Remarks:
8910  This function implements an operation of the ChannelXChainEnbl feature.
8911  This feature may not be available on all devices. Please refer to the
8912  specific device data sheet to determine availability or use the
8913  PLIB_DMA_ExistsChannelXChainEnbl function in your application to determine
8914  whether this feature is available.
8915 */
8916 
8917 void
8919  DMA_MODULE_ID index ,
8920  DMA_CHANNEL channel ) ;
8921 //******************************************************************************
8922 /* Function:
8923  bool PLIB_DMA_ChannelXChainIsEnabled ( DMA_MODULE_ID index,
8924  DMA_CHANNEL channel )
8925  Summary:
8926  Returns the chain status of the specified channel.
8927  Description:
8928  This function returns the chain status of the specified channel.
8929  Precondition:
8930  None.
8931  Parameters:
8932  channel - One of the possible DMA channels listed by DMA_CHANNEL
8933  Returns:
8934  - true - The channel chain is on for this channel
8935  - false - The channel chain is off for this channel
8936  Example:
8937  <code>
8938  bool ChchainStatus;
8939  ChchainStatus = PLIB_DMA_ChannelXChainIsEnabled( DMA_ID_0, DMA_CHANNEL_2 );
8940  </code>
8941  Remarks:
8942  This function implements an operation of the ChannelXChainEnbl feature.
8943  This feature may not be available on all devices. Please refer to the
8944  specific device data sheet to determine availability or use the
8945  PLIB_DMA_ExistsChannelXChainEnbl function in your application to determine
8946  whether this feature is available.
8947 */
8948 
8949 bool
8951  DMA_MODULE_ID index ,
8952  DMA_CHANNEL channel ) ;
8953 //******************************************************************************
8954 /* Function:
8955  void PLIB_DMA_ChannelXChainDisable( DMA_MODULE_ID index,
8956  DMA_CHANNEL channel )
8957  Summary:
8958  Disables the channel chaining for the specified DMA channel.
8959  Description:
8960  This function disables the channel chaining for the specified DMA channel.
8961  Precondition:
8962  None.
8963  Parameters:
8964  channel - One of the possible DMA channels listed by DMA_CHANNEL
8965  Returns:
8966  None.
8967  Example:
8968  <code>
8969  PLIB_DMA_ChannelXChainDisable( DMA_ID_0, DMA_CHANNEL_2 );
8970  </code>
8971  Remarks:
8972  This function implements an operation of the ChannelXChainEnbl feature.
8973  This feature may not be available on all devices. Please refer to the
8974  specific device data sheet to determine availability or use the
8975  PLIB_DMA_ExistsChannelXChainEnbl function in your application to determine
8976  whether this feature is available.
8977 */
8978 
8979 void
8981  DMA_MODULE_ID index ,
8982  DMA_CHANNEL channel ) ;
8983 //******************************************************************************
8984 /* Function:
8985  void PLIB_DMA_ChannelXDisabledEnablesEvents ( DMA_MODULE_ID index,
8986  DMA_CHANNEL channel )
8987  Summary:
8988  Channel start/abort events will be registered even if the channel is
8989  disabled.
8990  Description:
8991  This function will allow the channel register start/abort events even if the
8992  channel is disabled.
8993  Precondition:
8994  None.
8995  Parameters:
8996  channel - One of the possible DMA channels listed by DMA_CHANNEL
8997  Returns:
8998  None.
8999  Example:
9000  <code>
9001  PLIB_DMA_ChannelXDisabledEnablesEvents ( DMA_ID_0, DMA_CHANNEL_2 );
9002  </code>
9003  Remarks:
9004  This function implements an operation of the ChannelXDisabled feature.
9005  This feature may not be available on all devices. Please refer to the
9006  specific device data sheet to determine availability or use the
9007  PLIB_DMA_ExistsChannelXDisabled function in your application to automatically
9008  determine whether this feature is available.
9009 */
9010 
9011 void
9013  DMA_MODULE_ID index ,
9014  DMA_CHANNEL channel ) ;
9015 //******************************************************************************
9016 /* Function:
9017  void PLIB_DMA_ChannelXDisabledDisablesEvents ( DMA_MODULE_ID index,
9018  DMA_CHANNEL channel )
9019  Summary:
9020  Channel start/abort events will be ignored even if the channel is
9021  disabled.
9022  Description:
9023  This function will allow the channel start/abort events to be ignored even if
9024  the channel is disabled.
9025  Precondition:
9026  None.
9027  Parameters:
9028  channel - One of the possible DMA channels listed by DMA_CHANNEL
9029  Returns:
9030  None.
9031  Example:
9032  <code>
9033  PLIB_DMA_ChannelXDisabledDisablesEvents ( DMA_ID_0, DMA_CHANNEL_2 );
9034  </code>
9035  Remarks:
9036  This function implements an operation of the ChannelXDisabled feature.
9037  This feature may not be available on all devices. Please refer to the
9038  specific device data sheet to determine availability or use the
9039  PLIB_DMA_ExistsChannelXDisabled function in your application to automatically
9040  determine whether this feature is available.
9041 */
9042 
9043 void
9045  DMA_MODULE_ID index ,
9046  DMA_CHANNEL channel ) ;
9047 //******************************************************************************
9048 /* Function:
9049  void PLIB_DMA_ChannelXEnable ( DMA_MODULE_ID index,
9050  DMA_CHANNEL channel )
9051  Summary:
9052  Enable the specified channel.
9053  Description:
9054  This function will enable the specified channel.
9055  Precondition:
9056  None.
9057  Parameters:
9058  channel - One of the possible DMA channels listed by DMA_CHANNEL
9059  Returns:
9060  None.
9061  Example:
9062  <code>
9063  PLIB_DMA_ChannelXEnable ( DMA_ID_0, DMA_CHANNEL_2 );
9064  </code>
9065  Remarks:
9066  This function implements an operation of the ChannelX feature.
9067  This feature may not be available on all devices. Please refer to the
9068  specific device data sheet to determine availability or use the
9069  PLIB_DMA_ExistsChannelX function in your application to automatically
9070  determine whether this feature is available.
9071 */
9072 
9073 void
9075  DMA_MODULE_ID index ,
9076  DMA_CHANNEL channel ) ;
9077 //******************************************************************************
9078 /* Function:
9079  bool PLIB_DMA_ChannelXIsEnabled ( DMA_MODULE_ID index,
9080  DMA_CHANNEL channel )
9081  Summary:
9082  Return the enable status of the specified channel.
9083  Description:
9084  This function will return the enable status of the specified channel.
9085  Precondition:
9086  None.
9087  Parameters:
9088  channel - One of the possible DMA channels listed by DMA_CHANNEL
9089  Returns:
9090  - true - The specified DMA channel is enabled
9091  - false - The specified DMA channel is disabled
9092  Example:
9093  <code>
9094  bool chEnableStatus;
9095  chEnableStatus = PLIB_DMA_ChannelXIsEnabled ( DMA_ID_0, DMA_CHANNEL_2 );
9096  </code>
9097  Remarks:
9098  This function implements an operation of the ChannelX feature.
9099  This feature may not be available on all devices. Please refer to the
9100  specific device data sheet to determine availability or use the
9101  PLIB_DMA_ExistsChannelX function in your application to automatically
9102  determine whether this feature is available.
9103 */
9104 
9105 bool
9107  DMA_MODULE_ID index ,
9108  DMA_CHANNEL channel ) ;
9109 //******************************************************************************
9110 /* Function:
9111  void PLIB_DMA_ChannelXDisable ( DMA_MODULE_ID index,
9112  DMA_CHANNEL channel )
9113  Summary:
9114  Disable the specified channel.
9115  Description:
9116  This function will disable the specified channel.
9117  Precondition:
9118  None.
9119  Parameters:
9120  channel - One of the possible DMA channels listed by DMA_CHANNEL
9121  Returns:
9122  None.
9123  Example:
9124  <code>
9125  PLIB_DMA_ChannelXDisable ( DMA_ID_0, DMA_CHANNEL_2 );
9126  </code>
9127  Remarks:
9128  This function implements an operation of the ChannelX feature.
9129  This feature may not be available on all devices. Please refer to the
9130  specific device data sheet to determine availability or use the
9131  PLIB_DMA_ExistsChannelX function in your application to automatically
9132  determine whether this feature is available.
9133 */
9134 
9135 void
9137  DMA_MODULE_ID index ,
9138  DMA_CHANNEL channel ) ;
9139 //******************************************************************************
9140 /* Function:
9141  void PLIB_DMA_ChannelXChainToLower( DMA_MODULE_ID index,
9142  DMA_CHANNEL channel )
9143  Summary:
9144  Chains the specified channel to a channel lower in natural priority.
9145  Description:
9146  This function will chain the specified channel to a channel lower in
9147  natural priority. CH3 will be enabled by a CH4 transfer complete.
9148  Precondition:
9149  None.
9150  Parameters:
9151  channel - One of the possible DMA channels listed by DMA_CHANNEL
9152  Returns:
9153  None.
9154  Example:
9155  <code>
9156  PLIB_DMA_ChannelXChainToLower ( DMA_ID_0, DMA_CHANNEL_4 );
9157  </code>
9158  Remarks:
9159  This function implements an operation of the ChannelXChain feature.
9160  This feature may not be available on all devices. Please refer to the
9161  specific device data sheet to determine availability or use the
9162  PLIB_DMA_ExistsChannelXChain function in your application to automatically
9163  determine whether this feature is available.
9164 */
9165 
9166 void
9168  DMA_MODULE_ID index ,
9169  DMA_CHANNEL channel ) ;
9170 //******************************************************************************
9171 /* Function:
9172  void PLIB_DMA_ChannelXChainToHigher ( DMA_MODULE_ID index,
9173  DMA_CHANNEL channel )
9174  Summary:
9175  Chains the specified channel to a channel higher in natural priority.
9176  Description:
9177  This function will chain the specified channel to a channel higher in
9178  natural priority. CH5 will be enabled by a CH4 transfer complete.
9179  Precondition:
9180  None.
9181  Parameters:
9182  channel - One of the possible DMA channels listed by DMA_CHANNEL
9183  Returns:
9184  None.
9185  Example:
9186  <code>
9187  PLIB_DMA_ChannelXChainToHigher ( DMA_ID_0, DMA_CHANNEL_4 );
9188  </code>
9189  Remarks:
9190  This function implements an operation of the ChannelXChain feature.
9191  This feature may not be available on all devices. Please refer to the
9192  specific device data sheet to determine availability or use the
9193  PLIB_DMA_ExistsChannelXChain function in your application to automatically
9194  determine whether this feature is available.
9195 */
9196 
9197 void
9199  DMA_MODULE_ID index ,
9200  DMA_CHANNEL channel ) ;
9201 //******************************************************************************
9202 /* Function:
9203  void PLIB_DMA_ChannelXBusyActiveSet ( DMA_MODULE_ID index,
9204  DMA_CHANNEL channel )
9205  Summary:
9206  Sets the Busy bit to active.
9207  Description:
9208  This function sets the Busy bit to active, indicating the channel is active
9209  or has been enabled.
9210  Precondition:
9211  None.
9212  Parameters:
9213  channel - One of the possible DMA channels listed by DMA_CHANNEL
9214  Returns:
9215  None.
9216  Example:
9217  <code>
9218  PLIB_DMA_ChannelXBusyActiveSet ( DMA_ID_0, DMA_CHANNEL_4 );
9219  </code>
9220  Remarks:
9221  This function implements an operation of the ChannelXBusy feature.
9222  This feature may not be available on all devices. Please refer to the
9223  specific device data sheet to determine availability or use the
9224  PLIB_DMA_ExistsChannelXBusy function in your application to automatically
9225  determine whether this feature is available.
9226 */
9227 
9228 void
9230  DMA_MODULE_ID index ,
9231  DMA_CHANNEL channel ) ;
9232 //******************************************************************************
9233 /* Function:
9234  void PLIB_DMA_ChannelXBusyInActiveSet ( DMA_MODULE_ID index,
9235  DMA_CHANNEL channel )
9236  Summary:
9237  Sets the Busy bit to inactive.
9238  Description:
9239  This function sets the Busy bit to inactive, indicating the channel is inactive
9240  or has been disabled.
9241  Precondition:
9242  None.
9243  Parameters:
9244  channel - One of the possible DMA channels listed by DMA_CHANNEL
9245  Returns:
9246  None.
9247  Example:
9248  <code>
9249  PLIB_DMA_ChannelXBusyInActiveSet ( DMA_ID_0, DMA_CHANNEL_4 );
9250  </code>
9251  Remarks:
9252  This function implements an operation of the ChannelXBusy feature.
9253  This feature may not be available on all devices. Please refer to the
9254  specific device data sheet to determine availability or use the
9255  PLIB_DMA_ExistsChannelXBusy function in your application to automatically
9256  determine whether this feature is available.
9257 */
9258 
9259 void
9261  DMA_MODULE_ID index ,
9262  DMA_CHANNEL channel ) ;
9263 //******************************************************************************
9264 /* Function:
9265  bool PLIB_DMA_ChannelXBusyIsBusy ( DMA_MODULE_ID index,
9266  DMA_CHANNEL channel )
9267  Summary:
9268  Returns the busy status of the specified channel.
9269  Description:
9270  This function returns the busy status of the specified channel.
9271  Precondition:
9272  None.
9273  Parameters:
9274  channel - One of the possible DMA channels listed by DMA_CHANNEL
9275  Returns:
9276  - true - The channel is active or has been enabled
9277  - false - The channel is inactive or has been disabled
9278  Example:
9279  <code>
9280  bool chBusyStatus;
9281  chBusyStatus = PLIB_DMA_ChannelXBusyIsBusy ( DMA_ID_0, DMA_CHANNEL_4 );
9282  </code>
9283  Remarks:
9284  This function implements an operation of the ChannelXBusy feature.
9285  This feature may not be available on all devices. Please refer to the
9286  specific device data sheet to determine availability or use the
9287  PLIB_DMA_ExistsChannelXBusy function in your application to automatically
9288  determine whether this feature is available.
9289 */
9290 
9291 bool
9293  DMA_MODULE_ID index ,
9294  DMA_CHANNEL channel ) ;
9295 //******************************************************************************
9296 /* Function:
9297  void PLIB_DMA_ChannelXTransferDirectionSelect ( DMA_MODULE_ID index,
9298  DMA_CHANNEL channel,
9299  DMA_CHANNEL_TRANSFER_DIRECTION chTransferDirection )
9300  Summary:
9301  Selects the data transfer direction of the specified channel.
9302  Description:
9303  This function selects the data transfer direction of the specified channel.
9304  Precondition:
9305  None.
9306  Parameters:
9307  channel - One of the possible DMA channels listed by DMA_CHANNEL
9308  chTransferDirection - The transfer direction indicated by DMA_CHANNEL_TRANSFER_DIRECTION
9309  Returns:
9310  None.
9311  Example:
9312  <code>
9313  PLIB_DMA_ChannelXTransferDirectionSelect (
9314  DMA_ID_0,
9315  DMA_CHANNEL_4,
9316  DMA_READ_FROM_MEMORY_WRITE_TO_PERIPHERAL );
9317  </code>
9318  Remarks:
9319  This feature is not available on all devices. Please refer to the specific
9320  device data sheet to determine availability.
9321 */
9322 
9323 void
9325  DMA_MODULE_ID index ,
9326  DMA_CHANNEL channel ,
9327  DMA_CHANNEL_TRANSFER_DIRECTION chTransferDirection ) ;
9328 //******************************************************************************
9329 /* Function:
9330  DMA_CHANNEL_TRANSFER_DIRECTION PLIB_DMA_ChannelXTransferDirectionGet (
9331  DMA_MODULE_ID index,
9332  DMA_CHANNEL channel)
9333  Summary:
9334  Returns the data transfer direction of the specified channel.
9335  Description:
9336  This function returns the data transfer direction of the specified channel.
9337  Precondition:
9338  None.
9339  Parameters:
9340  channel - One of the possible DMA channels listed by DMA_CHANNEL
9341  Returns:
9342  - DMA_CHANNEL_TRANSFER_DIRECTION - The transfer direction indicated by the
9343  DMA_CHANNEL_TRANSFER_DIRECTION
9344  Example:
9345  <code>
9346  DMA_CHANNEL_TRANSFER_DIRECTION chTransferDirection;
9347  chTransferDirection = PLIB_DMA_ChannelXTransferDirectionGet (
9348  DMA_ID_0,
9349  DMA_CHANNEL_4 );
9350  </code>
9351  Remarks:
9352  This feature is not available on all devices. Please refer to the specific
9353  device data sheet to determine availability.
9354 */
9355 
9356 DMA_CHANNEL_TRANSFER_DIRECTION
9358  DMA_MODULE_ID index ,
9359  DMA_CHANNEL channel ) ;
9360 //******************************************************************************
9361 /* Function:
9362  void PLIB_DMA_ChannelXStartAddressOffsetSet( DMA_MODULE_ID index,
9363  DMA_CHANNEL channel ,
9364  uint16_t address,
9365  DMA_ADDRESS_OFFSET_TYPE offset )
9366  Summary:
9367  Sets the primary/secondary start address (DPSRAM) offset to the value
9368  specified depending on the offset type specified for the specified channel.
9369  Description:
9370  This function sets the primary/secondary start address (DPSRAM) offset to the value
9371  specified depending on the offset type specified for the specified channel.
9372  Precondition:
9373  None.
9374  Parameters:
9375  channel - One of the possible DMA channels listed by DMA_CHANNEL
9376  address - The primary/secondary DPSRAM start address offset
9377  offset - The type of the address offset (primary/secondary)
9378  Returns:
9379  None.
9380  Example:
9381  <code>
9382  uint16_t address = 0x100;
9383  PLIB_DMA_ChannelXStartAddressOffsetSet ( DMA_ID_0,
9384  DMA_CHANNEL_4,
9385  address,
9386  DMA_ADDRESS_OFFSET_PRIMARY );
9387  </code>
9388  Remarks:
9389  This feature is not available on all devices. Please refer to the specific
9390  device data sheet to determine availability.
9391 */
9392 
9393 void
9395  DMA_MODULE_ID index ,
9396  DMA_CHANNEL channel ,
9397  uint16_t address ,
9398  DMA_ADDRESS_OFFSET_TYPE offset ) ;
9399 //******************************************************************************
9400 /* Function:
9401  uint16_t PLIB_DMA_ChannelXStartAddressOffsetGet ( DMA_MODULE_ID index,
9402  DMA_CHANNEL channel,
9403  DMA_ADDRESS_OFFSET_TYPE offset)
9404  Summary:
9405  Gets the primary/secondary start address (DPSRAM) offset.
9406  Description:
9407  This function gets the primary/secondary start address (DPSRAM) offset.
9408  Precondition:
9409  None.
9410  Parameters:
9411  channel - One of the possible DMA channels listed by DMA_CHANNEL
9412  offset - The type of the address offset (primary/secondary)
9413  Returns:
9414  - uint16_t - The primary/secondary DPSRAM start address offset
9415  Example:
9416  <code>
9417  uint16_t addressOffsetA;
9418  addressOffsetA = PLIB_DMA_ChannelXStartAddressOffsetGet (
9419  DMA_ID_0,
9420  DMA_CHANNEL_4,
9421  address,
9422  DMA_ADDRESS_OFFSET_PRIMARY );
9423  </code>
9424  Remarks:
9425  This feature is not available on all devices. Please refer to the specific
9426  device data sheet to determine availability.
9427 */
9428 
9429 uint16_t
9431  DMA_MODULE_ID index ,
9432  DMA_CHANNEL channel ,
9433  DMA_ADDRESS_OFFSET_TYPE offset ) ;
9434 //******************************************************************************
9435 /* Function:
9436  void PLIB_DMA_ChannelXPeripheralAddressSet( DMA_MODULE_ID index,
9437  DMA_CHANNEL channel ,
9438  uint16_t peripheraladdress )
9439  Summary:
9440  Sets the peripheral address for the specified channel.
9441  Description:
9442  This function sets the peripheral address for the specified channel.
9443  Precondition:
9444  None.
9445  Parameters:
9446  channel - One of the possible DMA channels listed by DMA_CHANNEL
9447  peripheraladdress - The peripheral address for the specified channel
9448  Returns:
9449  None.
9450  Example:
9451  <code>
9452  uint16_t peripheraladdress = 0x100;
9453  PLIB_DMA_ChannelXPeripheralAddressSet ( DMA_ID_0,
9454  DMA_CHANNEL_4,
9455  peripheraladdress );
9456  </code>
9457  Remarks:
9458  This feature is not available on all devices. Please refer to the specific
9459  device data sheet to determine availability.
9460 */
9461 
9462 void
9464  DMA_MODULE_ID index ,
9465  DMA_CHANNEL channel ,
9466  uint16_t peripheraladdress ) ;
9467 //******************************************************************************
9468 /* Function:
9469  uint16_t PLIB_DMA_ChannelXPeripheralAddressGet( DMA_MODULE_ID index,
9470  DMA_CHANNEL channel )
9471  Summary:
9472  Gets the peripheral address configured for the specified channel.
9473  Description:
9474  This function gets the peripheral address configured for the specified channel.
9475  Precondition:
9476  None.
9477  Parameters:
9478  channel - One of the possible DMA channels listed by DMA_CHANNEL
9479  Returns:
9480  - uint16_t - The peripheral address configured for the specified channel
9481  Example:
9482  <code>
9483  uint16_t peripheraladdress;
9484  peripheraladdress = PLIB_DMA_ChannelXPeripheralAddressGet ( DMA_ID_0,
9485  DMA_CHANNEL_4 );
9486  </code>
9487  Remarks:
9488  This feature is not available on all devices. Please refer to the specific
9489  device data sheet to determine availability.
9490 */
9491 
9492 uint16_t
9494  DMA_MODULE_ID index ,
9495  DMA_CHANNEL channel ) ;
9496 //******************************************************************************
9497 /* Function:
9498  void PLIB_DMA_ChannelXTransferCountSet( DMA_MODULE_ID index,
9499  DMA_CHANNEL channel ,
9500  uint16_t transferCount )
9501  Summary:
9502  Sets the DMA data transfer count for the specified channel.
9503  Description:
9504  This function sets the DMA data transfer count for the specified channel.
9505  Precondition:
9506  None.
9507  Parameters:
9508  channel - One of the possible DMA channels listed by DMA_CHANNEL
9509  transferCount - The DMA transfer count for the channel
9510  Returns:
9511  None.
9512  Example:
9513  <code>
9514  uint16_t transferCount = 0x10;
9515  PLIB_DMA_ChannelXTransferCountSet ( DMA_ID_0,
9516  DMA_CHANNEL_4,
9517  transferCount );
9518  </code>
9519  Remarks:
9520  This feature is not available on all devices. Please refer to the specific
9521  device data sheet to determine availability.
9522 */
9523 
9524 void
9526  DMA_MODULE_ID index ,
9527  DMA_CHANNEL channel ,
9528  uint16_t transferCount ) ;
9529 //******************************************************************************
9530 /* Function:
9531  uint16_t PLIB_DMA_ChannelXTransferCountGet( DMA_MODULE_ID index,
9532  DMA_CHANNEL channel )
9533  Summary:
9534  Gets the DMA data transfer count that is programmed for the specified channel.
9535  Description:
9536  This function gets the DMA data transfer count that is programmed for the specified channel.
9537  Precondition:
9538  None.
9539  Parameters:
9540  channel - One of the possible DMA channels listed by DMA_CHANNEL
9541  Returns:
9542  - uint16_t - The DMA transfer count for the channel
9543  Example:
9544  <code>
9545  uint16_t transferCount;
9546  transferCount = PLIB_DMA_ChannelXTransferCountGet ( DMA_ID_0,
9547  DMA_CHANNEL_4 );
9548  </code>
9549  Remarks:
9550  This feature is not available on all devices. Please refer to the specific
9551  device data sheet to determine availability.
9552 */
9553 
9554 uint16_t
9556  DMA_MODULE_ID index ,
9557  DMA_CHANNEL channel ) ;
9558 //******************************************************************************
9559 /* Function:
9560  void PLIB_DMA_ChannelXSourceAddressModeSelect (
9561  DMA_MODULE_ID index,
9562  DMA_CHANNEL channel,
9563  DMA_SOURCE_ADDRESSING_MODE sourceAddressMode )
9564  Summary:
9565  Sets the source address mode of the specified channel.
9566  Description:
9567  This function sets the source address mode of the specified channel.
9568  Precondition:
9569  None.
9570  Parameters:
9571  channel - One of the possible DMA channels listed by DMA_CHANNEL
9572  sourceAddressMode - One of the possible source addressing modes listed by
9573  DMA_SOURCE_ADDRESSING_MODE
9574  Returns:
9575  None.
9576  Example:
9577  <code>
9578  PLIB_DMA_ChannelXSourceAddressModeSelect (
9579  DMA_ID_0,
9580  DMA_CHANNEL_4,
9581  DMA_ADDRESSING_SOURCE_INCREMENT_BASED_ON_SIZE );
9582  </code>
9583  Remarks:
9584  This feature is not available on all devices. Please refer to the specific
9585  device data sheet to determine availability.
9586 */
9587 
9588 void
9590  DMA_MODULE_ID index ,
9591  DMA_CHANNEL channel ,
9592  DMA_SOURCE_ADDRESSING_MODE sourceAddressMode ) ;
9593 //******************************************************************************
9594 /* Function:
9595  DMA_SOURCE_ADDRESSING_MODE PLIB_DMA_ChannelXSourceAddressModeGet (
9596  DMA_MODULE_ID index,
9597  DMA_CHANNEL channel )
9598  Summary:
9599  Gets the source address mode of the specified channel.
9600  Description:
9601  This function gets the source address mode of the specified channel.
9602  Precondition:
9603  None.
9604  Parameters:
9605  channel - One of the possible DMA channels listed by DMA_CHANNEL
9606  Returns:
9607  - DMA_SOURCE_ADDRESSING_MODE - One of the possible source addressing modes
9608  listed by DMA_SOURCE_ADDRESSING_MODE
9609  Example:
9610  <code>
9611  DMA_SOURCE_ADDRESSING_MODE sourceAddressMode;
9612  sourceAddressMode = PLIB_DMA_ChannelXSourceAddressModeGet ( DMA_ID_0,
9613  DMA_CHANNEL_4 );
9614  </code>
9615  Remarks:
9616  This feature is not available on all devices. Please refer to the specific
9617  device data sheet to determine availability.
9618 */
9619 
9620 DMA_SOURCE_ADDRESSING_MODE
9622  DMA_MODULE_ID index ,
9623  DMA_CHANNEL channel ) ;
9624 //******************************************************************************
9625 /* Function:
9626  void PLIB_DMA_ChannelXDestinationAddressModeSelect (
9627  DMA_MODULE_ID index,
9628  DMA_CHANNEL channel,
9629  DMA_DESTINATION_ADDRESSING_MODE destinationAddressMode )
9630  Summary:
9631  Sets the source address mode of the specified channel.
9632  Description:
9633  This function Sets the source address mode of the specified channel.
9634  Precondition:
9635  None.
9636  Parameters:
9637  channel - One of the possible DMA channels listed by DMA_CHANNEL
9638  destinationAddressMode - One of the possible source addressing modes listed by
9639  DMA_DESTINATION_ADDRESSING_MODE
9640  Returns:
9641  None.
9642  Example:
9643  <code>
9644  PLIB_DMA_ChannelXDestinationAddressModeSelect (
9645  DMA_ID_0,
9646  DMA_CHANNEL_4,
9647  DMA_ADDRESSING_DESTINATION_INCREMENT_BASED_ON_SIZE );
9648  </code>
9649  Remarks:
9650  This feature is not available on all devices. Please refer to the specific
9651  device data sheet to determine availability.
9652 */
9653 
9654 void
9656  DMA_MODULE_ID index ,
9657  DMA_CHANNEL channel ,
9658  DMA_DESTINATION_ADDRESSING_MODE destinationAddressMode ) ;
9659 //******************************************************************************
9660 /* Function:
9661  DMA_DESTINATION_ADDRESSING_MODE PLIB_DMA_ChannelXDestinationAddressModeGet (
9662  DMA_MODULE_ID index,
9663  DMA_CHANNEL channel )
9664  Summary:
9665  Gets the source address mode of the specified channel.
9666  Description:
9667  This function gets the source address mode of the specified channel.
9668  Precondition:
9669  None.
9670  Parameters:
9671  channel - One of the possible DMA channels listed by DMA_CHANNEL
9672  Returns:
9673  - destinationAddressMode - One of the possible source addressing modes listed by
9674  DMA_DESTINATION_ADDRESSING_MODE
9675  Example:
9676  <code>
9677  DMA_SOURCE_ADDRESSING_MODE destinationAddressMode;
9678  destinationAddressMode = PLIB_DMA_ChannelXDestinationAddressModeGet (
9679  DMA_ID_0,
9680  DMA_CHANNEL_4 );
9681  </code>
9682  Remarks:
9683  This feature is not available on all devices. Please refer to the specific
9684  device data sheet to determine availability.
9685 */
9686 
9687 DMA_DESTINATION_ADDRESSING_MODE
9689  DMA_MODULE_ID index ,
9690  DMA_CHANNEL channel ) ;
9691 //******************************************************************************
9692 /* Function:
9693  void PLIB_DMA_ChannelXAddressModeSelect (
9694  DMA_MODULE_ID index,
9695  DMA_CHANNEL channel,
9696  DMA_CHANNEL_ADDRESSING_MODE channelAddressMode )
9697  Summary:
9698  Sets the channel address mode.
9699  Description:
9700  This function sets the channel address mode.
9701  Precondition:
9702  None.
9703  Parameters:
9704  channel - One of the possible DMA channels listed by DMA_CHANNEL
9705  channelAddressMode - One of the possible channel addressing modes listed by
9706  DMA_CHANNEL_ADDRESSING_MODE
9707  Returns:
9708  None.
9709  Example:
9710  <code>
9711  PLIB_DMA_ChannelXAddressModeSelect (
9712  DMA_ID_0,
9713  DMA_CHANNEL_4,
9714  DMA_ADDRESSING_REGISTER_INDIRECT_WITH_POST_INCREMENT );
9715  </code>
9716  Remarks:
9717  This feature is not available on all devices. Please refer to the specific
9718  device data sheet to determine availability.
9719 */
9720 
9721 void
9723  DMA_MODULE_ID index ,
9724  DMA_CHANNEL channel ,
9725  DMA_CHANNEL_ADDRESSING_MODE channelAddressMode ) ;
9726 //******************************************************************************
9727 /* Function:
9728  DMA_CHANNEL_ADDRESSING_MODE PLIB_DMA_ChannelXAddressModeGet (
9729  DMA_MODULE_ID index,
9730  DMA_CHANNEL channel )
9731  Summary:
9732  Gets the channel address mode.
9733  Description:
9734  This function gets the channel address mode.
9735  Precondition:
9736  None.
9737  Parameters:
9738  channel - One of the possible DMA channels listed by DMA_CHANNEL
9739  Returns:
9740  - channelAddressMode - One of the possible source addressing modes listed by
9741  DMA_CHANNEL_ADDRESSING_MODE
9742  Example:
9743  <code>
9744  DMA_CHANNEL_ADDRESSING_MODE channelAddressMode;
9745  channelAddressMode = PLIB_DMA_ChannelXAddressModeGet ( DMA_ID_0,
9746  DMA_CHANNEL_4 );
9747  </code>
9748  Remarks:
9749  This feature is not available on all devices. Please refer to the specific
9750  device data sheet to determine availability.
9751 */
9752 
9753 DMA_CHANNEL_ADDRESSING_MODE
9755  DMA_MODULE_ID index ,
9756  DMA_CHANNEL channel ) ;
9757 // *****************************************************************************
9758 // *****************************************************************************
9759 // Section: DMA Channel Event Configuration functions
9760 // *****************************************************************************
9761 // *****************************************************************************
9762 //******************************************************************************
9763 /* Function:
9764  void PLIB_DMA_ChannelXTriggerEnable ( DMA_MODULE_ID index,
9765  DMA_CHANNEL channel,
9766  DMA_CHANNEL_TRIGGER_TYPE trigger )
9767  Summary:
9768  Enables the specified DMA channel trigger.
9769  Description:
9770  This function enables the specified DMA channel trigger.
9771  Precondition:
9772  None.
9773  Parameters:
9774  channel - One of the possible DMA channels listed by DMA_CHANNEL
9775  trigger - Type of trigger (transfer start/abort/pattern match abort)
9776  Returns:
9777  None.
9778  Example:
9779  <code>
9780  PLIB_DMA_ChannelXTriggerEnable ( DMA_ID_0,
9781  DMA_CHANNEL_4,
9782  DMA_CHANNEL_TRIGGER_TRANSFER_ABORT );
9783  </code>
9784  Remarks:
9785  This function implements an operation of the ChannelXTrigger feature.
9786  This feature may not be available on all devices. Please refer to the
9787  specific device data sheet to determine availability or use the
9788  PLIB_DMA_ExistsChannelXTrigger function in your application to automatically
9789  determine whether this feature is available.
9790 */
9791 
9792 void
9794  DMA_MODULE_ID index ,
9795  DMA_CHANNEL channel ,
9796  DMA_CHANNEL_TRIGGER_TYPE trigger ) ;
9797 //******************************************************************************
9798 /* Function:
9799  bool PLIB_DMA_ChannelXTriggerIsEnabled( DMA_MODULE_ID index,
9800  DMA_CHANNEL channel,
9801  DMA_CHANNEL_TRIGGER_TYPE trigger )
9802  Summary:
9803  Returns the enable status of the specified DMA transfer/abort trigger.
9804  Description:
9805  This function returns the enable status of the specified DMA transfer/abort trigger.
9806  Precondition:
9807  None.
9808  Parameters:
9809  channel - One of the possible DMA channels listed by DMA_CHANNEL
9810  trigger - Type of trigger (transfer start/abort/pattern match abort)
9811  Returns:
9812  - true - The specified trigger is enabled
9813  - false - The specified trigger is disabled
9814  Example:
9815  <code>
9816  bool startTriggerstatus;
9817  startTriggerstatus = PLIB_DMA_ChannelXTriggerIsEnabled (
9818  DMA_ID_0,
9819  DMA_CHANNEL_4,
9820  DMA_CHANNEL_TRIGGER_TRANSFER_START );
9821  </code>
9822  Remarks:
9823  This function implements an operation of the ChannelXTrigger feature.
9824  This feature may not be available on all devices. Please refer to the
9825  specific device data sheet to determine availability or use the
9826  PLIB_DMA_ExistsChannelXTrigger function in your application to automatically
9827  determine whether this feature is available.
9828 */
9829 
9830 bool
9832  DMA_MODULE_ID index ,
9833  DMA_CHANNEL channel ,
9834  DMA_CHANNEL_TRIGGER_TYPE trigger ) ;
9835 //******************************************************************************
9836 /* Function:
9837  void PLIB_DMA_ChannelXTriggerDisable ( DMA_MODULE_ID index,
9838  DMA_CHANNEL channel,
9839  DMA_CHANNEL_TRIGGER_TYPE trigger )
9840  Summary:
9841  Disables the DMA transfer abort via a matching interrupt (specified by the IRQ).
9842  Description:
9843  This function disables the DMA transfer abort via a matching interrupt
9844  (specified by the IRQ). The interrupt number IRQ is ignored and does not terminate
9845  a transfer.
9846  Precondition:
9847  None.
9848  Parameters:
9849  channel - One of the possible DMA channels listed by DMA_CHANNEL
9850  trigger - Type of trigger (transfer start/abort/pattern match abort)
9851  Returns:
9852  None.
9853  Example:
9854  <code>
9855  PLIB_DMA_ChannelXTriggerDisable ( DMA_ID_0,
9856  DMA_CHANNEL_4,
9857  DMA_CHANNEL_TRIGGER_PATTERN_MATCH_ABORT );
9858  </code>
9859  Remarks:
9860  This function implements an operation of the ChannelXTrigger feature.
9861  This feature may not be available on all devices. Please refer to the
9862  specific device data sheet to determine availability or use the
9863  PLIB_DMA_ExistsChannelXTrigger function in your application to automatically
9864  determine whether this feature is available.
9865 */
9866 
9867 void
9869  DMA_MODULE_ID index ,
9870  DMA_CHANNEL channel ,
9871  DMA_CHANNEL_TRIGGER_TYPE trigger ) ;
9872 //******************************************************************************
9873 /* Function:
9874  void PLIB_DMA_ChannelXTriggerSourceNumberGet ( DMA_MODULE_ID index,
9875  DMA_CHANNEL channel)
9876  Summary:
9877  Gets the source number for the DMA channel interrupts.
9878  Description:
9879  This function returns the interrupt source number for the specified
9880  DMA channel.
9881  Precondition:
9882  None.
9883  Parameters:
9884  channel - One of the possible DMA channels listed by DMA_CHANNEL
9885  Returns:
9886  None.
9887  Example:
9888  <code>
9889  PLIB_DMA_ChannelXTriggerSourceNumberGet ( DMA_ID_0,
9890  DMA_CHANNEL_4);
9891  </code>
9892  Remarks:
9893  This function implements an operation of the ChannelXTrigger feature.
9894  This feature may not be available on all devices. Please refer to the
9895  specific device data sheet to determine availability or use the
9896  PLIB_DMA_ExistsChannelXTrigger function in your application to automatically
9897  determine whether this feature is available.
9898 */
9899 
9900 DMA_CHANNEL_INT_SOURCE
9902  DMA_MODULE_ID index ,
9903  DMA_CHANNEL channel ) ;
9904 //******************************************************************************
9905 /* Function:
9906  void PLIB_DMA_ChannelXStartIRQSet ( DMA_MODULE_ID index,
9907  DMA_CHANNEL channel,
9908  DMA_TRIGGER_SOURCE IRQnum )
9909  Summary:
9910  Sets the IRQ to initiate the DMA transfer on the specified channel.
9911  Description:
9912  This function sets the IRQ to initiate the DMA transfer on the specified channel.
9913  (IRQ to start the channel transfer.)
9914  Precondition:
9915  None.
9916  Parameters:
9917  channel - One of the possible DMA channels listed by DMA_CHANNEL
9918  IRQnum - The IRQ number of the trigger source of type DMA_TRIGGER_SOURCE
9919  Returns:
9920  None.
9921  Example:
9922  <code>
9923  DMA_TRIGGER_SOURCE irq = DMA_TRIGGER_OUTPUT_COMPARE_1;
9924  PLIB_DMA_ChannelXStartIRQSet ( DMA_ID_0,
9925  DMA_CHANNEL_4,
9926  irq );
9927  </code>
9928  Remarks:
9929  This function implements an operation of the ChannelXStartIRQ feature.
9930  This feature may not be available on all devices. Please refer to the
9931  specific device data sheet to determine availability or use the
9932  PLIB_DMA_ExistsChannelXStartIRQ function in your application to automatically
9933  determine whether this feature is available.
9934 */
9935 
9936 void
9938  DMA_MODULE_ID index ,
9939  DMA_CHANNEL channel ,
9940  DMA_TRIGGER_SOURCE IRQnum ) ;
9941 //******************************************************************************
9942 /* Function:
9943  void PLIB_DMA_ChannelXAbortIRQSet ( DMA_MODULE_ID index,
9944  DMA_CHANNEL channel,
9945  DMA_TRIGGER_SOURCE IRQ )
9946  Summary:
9947  Sets the IRQ to abort the DMA transfer on the specified channel.
9948  Description:
9949  This function sets the IRQ to abort the DMA transfer on the specified channel.
9950  (IRQ to start the channel transfer.)
9951  Precondition:
9952  None.
9953  Parameters:
9954  channel - One of the possible DMA channels listed by DMA_CHANNEL
9955  IRQnum - The IRQ number of the trigger source of type DMA_TRIGGER_SOURCE
9956  Returns:
9957  None.
9958  Example:
9959  <code>
9960  DMA_TRIGGER_SOURCE irq = DMA_TRIGGER_TIMER_CORE;
9961  PLIB_DMA_ChannelXAbortIRQSet ( DMA_ID_0,
9962  DMA_CHANNEL_4,
9963  irq );
9964  </code>
9965  Remarks:
9966  This function implements an operation of the ChannelXAbortIRQ feature.
9967  This feature may not be available on all devices. Please refer to the
9968  specific device data sheet to determine availability or use the
9969  PLIB_DMA_ExistsChannelXAbortIRQ function in your application to automatically
9970  determine whether this feature is available.
9971 */
9972 
9973 void
9975  DMA_MODULE_ID index ,
9976  DMA_CHANNEL channel ,
9977  DMA_TRIGGER_SOURCE IRQ ) ;
9978 //******************************************************************************
9979 /* Function:
9980  void PLIB_DMA_ChannelXDataSizeSelect ( DMA_MODULE_ID index,
9981  DMA_CHANNEL channel,
9982  DMA_CHANNEL_DATA_SIZE channelDataSize )
9983  Summary:
9984  Selects the data size for the specified channel.
9985  Description:
9986  This function selects the data size for the specified channel.
9987  Precondition:
9988  None.
9989  Parameters:
9990  channel - One of the possible DMA channels listed by DMA_CHANNEL
9991  channelDataSize - One of the possible data sizes listed by DMA_CHANNEL_DATA_SIZE
9992  Returns:
9993  None.
9994  Example:
9995  <code>
9996  DMA_CHANNEL_DATA_SIZE channelDataSize = DMA_CHANNEL_DATA_8;
9997  PLIB_DMA_ChannelXDataSizeSelect ( DMA_ID_0,
9998  DMA_CHANNEL_4,
9999  channelDataSize );
10000  </code>
10001  Remarks:
10002  This feature is not available on all devices. Please refer to the specific
10003  device data sheet to determine availability.
10004 */
10005 
10006 void
10008  DMA_MODULE_ID index ,
10009  DMA_CHANNEL channel ,
10010  DMA_CHANNEL_DATA_SIZE channelDataSize ) ;
10011 //******************************************************************************
10012 /* Function:
10013  DMA_CHANNEL_DATA_SIZE PLIB_DMA_ChannelXDataSizeGet ( DMA_MODULE_ID index,
10014  DMA_CHANNEL channel )
10015  Summary:
10016  Returns the current data size for the specified channel.
10017  Description:
10018  This function returns the current data size for the specified channel.
10019  Precondition:
10020  None.
10021  Parameters:
10022  channel - One of the possible DMA channels listed by DMA_CHANNEL
10023  Returns:
10024  - channelDataSize - One of the possible data sizes listed by
10025  DMA_CHANNEL_DATA_SIZE
10026  Example:
10027  <code>
10028  DMA_CHANNEL_DATA_SIZE channelDataSize;
10029  channelDataSize = PLIB_DMA_ChannelXDataSizeGet( DMA_ID_0,
10030  DMA_CHANNEL_4 );
10031  </code>
10032  Remarks:
10033  This feature is not available on all devices. Please refer to the specific
10034  device data sheet to determine availability.
10035 */
10036 
10037 DMA_CHANNEL_DATA_SIZE
10039  DMA_MODULE_ID index ,
10040  DMA_CHANNEL channel ) ;
10041 //******************************************************************************
10042 /* Function:
10043  void PLIB_DMA_ChannelXOperatingTransferModeSelect (
10044  DMA_MODULE_ID index,
10045  DMA_CHANNEL channel,
10046  DMA_TRANSFER_MODE channeltransferMode )
10047  Summary:
10048  Selects the transfer/operating mode for the specified channel.
10049  Description:
10050  This function selects the transfer/operating mode for the specified channel.
10051  (Transfer mode and operating mode are used interchangeably.)
10052  Precondition:
10053  None.
10054  Parameters:
10055  channel - One of the possible DMA channels listed by DMA_CHANNEL
10056  channeltransferMode - One of the possible operating/transfer modes listed by
10057  DMA_TRANSFER_MODE
10058  Returns:
10059  None.
10060  Example:
10061  <code>
10062  DMA_TRANSFER_MODE channeltransferMode = DMA_MODE_REPEATED_CONTINUOUS;
10063  PLIB_DMA_ChannelXOperatingTransferModeSelect ( DMA_ID_0,
10064  DMA_CHANNEL_4,
10065  channeltransferMode );
10066  </code>
10067  Remarks:
10068  This feature is not available on all devices. Please refer to the specific
10069  device data sheet to determine availability.
10070 */
10071 
10072 void
10074  DMA_MODULE_ID index ,
10075  DMA_CHANNEL channel ,
10076  DMA_TRANSFER_MODE channeltransferMode ) ;
10077 //******************************************************************************
10078 /* Function:
10079  DMA_TRANSFER_MODE PLIB_DMA_ChannelXOperatingTransferModeGet (
10080  DMA_MODULE_ID index,
10081  DMA_CHANNEL channel )
10082  Summary:
10083  Returns the current transfer/operating mode for the specified channel.
10084  Description:
10085  This function returns the current transfer/operating mode for the specified channel.
10086  (Transfer mode and operating mode are used interchangeably.)
10087  Precondition:
10088  None.
10089  Parameters:
10090  channel - One of the possible DMA channels listed by DMA_CHANNEL
10091  Returns:
10092  - channeltransferMode - One of the possible operating/transfer modes listed
10093  by DMA_TRANSFER_MODE
10094  Example:
10095  <code>
10096  DMA_TRANSFER_MODE channeltransferMode;
10097  channeltransferMode = PLIB_DMA_ChannelXOperatingTransferModeGet (
10098  DMA_ID_0,
10099  DMA_CHANNEL_4 );
10100  </code>
10101  Remarks:
10102  This feature is not available on all devices. Please refer to the specific
10103  device data sheet to determine availability.
10104 */
10105 
10106 DMA_TRANSFER_MODE
10108  DMA_MODULE_ID index ,
10109  DMA_CHANNEL channel ) ;
10110 //******************************************************************************
10111 /* Function:
10112  void PLIB_DMA_ChannelXReloadEnable( DMA_MODULE_ID index,
10113  DMA_CHANNEL channel )
10114  Summary:
10115  Enables reloading of the address and count registers.
10116  Description:
10117  This function enables reloading of the address and count registers. The source,
10118  destination address, and the DMA count registers are reloaded to their previous
10119  values upon the start of the next operation.
10120  Precondition:
10121  None.
10122  Parameters:
10123  channel - One of the possible DMA channels listed by DMA_CHANNEL
10124  Returns:
10125  None.
10126  Example:
10127  <code>
10128  PLIB_DMA_ChannelXReloadEnable ( DMA_ID_0,
10129  DMA_CHANNEL_4 );
10130  </code>
10131  Remarks:
10132  This feature is not available on all devices. Please refer to the specific
10133  device data sheet to determine availability.
10134 */
10135 
10136 void
10138  DMA_MODULE_ID index ,
10139  DMA_CHANNEL channel ) ;
10140 //******************************************************************************
10141 /* Function:
10142  bool PLIB_DMA_ChannelXReloadIsEnabled ( DMA_MODULE_ID index,
10143  DMA_CHANNEL channel )
10144  Summary:
10145  Returns the address and count registers reload enable status.
10146  Description:
10147  This function returns the address and count registers reload enable status.
10148  Precondition:
10149  None.
10150  Parameters:
10151  channel - One of the possible DMA channels listed by DMA_CHANNEL
10152  Returns:
10153  - true - The address and count registers reload is enabled
10154  - false - The address and count registers reload is disabled
10155  Example:
10156  <code>
10157  bool chAddressCountReloadStatus;
10158  chAddressCountReloadStatus = PLIB_DMA_ChannelXReloadIsEnabled (
10159  DMA_ID_0,
10160  DMA_CHANNEL_4 );
10161  </code>
10162  Remarks:
10163  This feature is not available on all devices. Please refer to the specific
10164  device data sheet to determine availability.
10165 */
10166 
10167 bool
10169  DMA_MODULE_ID index ,
10170  DMA_CHANNEL channel ) ;
10171 //******************************************************************************
10172 /* Function:
10173  void PLIB_DMA_ChannelXReloadDisable ( DMA_MODULE_ID index,
10174  DMA_CHANNEL channel )
10175  Summary:
10176  Disables reloading of the address and count registers.
10177  Description:
10178  This function disables reloading of the address and count registers. The source, destination
10179  address, and the DMA count registers are not reloaded to their previous values upon
10180  the start of the next operation.
10181  Precondition:
10182  None.
10183  Parameters:
10184  channel - One of the possible DMA channels listed by DMA_CHANNEL
10185  Returns:
10186  None.
10187  Example:
10188  <code>
10189  PLIB_DMA_ChannelXReloadDisable ( DMA_ID_0,
10190  DMA_CHANNEL_4 );
10191  </code>
10192  Remarks:
10193  This feature is not available on all devices. Please refer to the specific
10194  device data sheet to determine availability.
10195 */
10196 
10197 void
10199  DMA_MODULE_ID index ,
10200  DMA_CHANNEL channel ) ;
10201 //******************************************************************************
10202 /* Function:
10203  void PLIB_DMA_ChannelXNullWriteModeEnable ( DMA_MODULE_ID index,
10204  DMA_CHANNEL channel )
10205  Summary:
10206  Enables the Null Write mode.
10207  Description:
10208  This function enables the Null Write mode. A dummy write is initiated to the
10209  source address for every write to the destination address.
10210  Precondition:
10211  None.
10212  Parameters:
10213  channel - One of the possible DMA channels listed by DMA_CHANNEL
10214  Returns:
10215  None.
10216  Example:
10217  <code>
10218  PLIB_DMA_ChannelXNullWriteModeEnable ( DMA_ID_0,
10219  DMA_CHANNEL_4 );
10220  </code>
10221  Remarks:
10222  This feature is not available on all devices. Please refer to the specific
10223  device data sheet to determine availability.
10224 */
10225 
10226 void
10228  DMA_MODULE_ID index ,
10229  DMA_CHANNEL channel ) ;
10230 //******************************************************************************
10231 /* Function:
10232  bool PLIB_DMA_ChannelXNullWriteModeIsEnabled ( DMA_MODULE_ID index,
10233  DMA_CHANNEL channel )
10234  Summary:
10235  Returns the enable status of the Null Write mode for the specified channel.
10236  Description:
10237  This function returns the enable status of the Null Write mode for the specified channel.
10238  Precondition:
10239  None.
10240  Parameters:
10241  channel - One of the possible DMA channels listed by DMA_CHANNEL
10242  Returns:
10243  - true - Null write mode is enabled for this channel
10244  - false - Null write mode is disabled for this channel
10245  Example:
10246  <code>
10247  bool chNullWriteStatus;
10248  chNullWriteStatus = PLIB_DMA_ChannelXNullWriteModeIsEnabled (
10249  DMA_ID_0,
10250  DMA_CHANNEL_4 );
10251  </code>
10252  Remarks:
10253  This feature is not available on all devices. Please refer to the specific
10254  device data sheet to determine availability.
10255 */
10256 
10257 bool
10259  DMA_MODULE_ID index ,
10260  DMA_CHANNEL channel ) ;
10261 //******************************************************************************
10262 /* Function:
10263  void PLIB_DMA_ChannelXNullWriteModeDisable( DMA_MODULE_ID index,
10264  DMA_CHANNEL channel )
10265  Summary:
10266  Disables the Null Write mode.
10267  Description:
10268  This function disables the Null Write mode. No dummy write is initiated.
10269  Precondition:
10270  None.
10271  Parameters:
10272  channel - One of the possible DMA channels listed by DMA_CHANNEL
10273  Returns:
10274  None.
10275  Example:
10276  <code>
10277  PLIB_DMA_ChannelXNullWriteModeDisable ( DMA_ID_0,
10278  DMA_CHANNEL_4 );
10279  </code>
10280  Remarks:
10281  This feature is not available on all devices. Please refer to the specific
10282  device data sheet to determine availability.
10283 */
10284 
10285 void
10287  DMA_MODULE_ID index ,
10288  DMA_CHANNEL channel ) ;
10289 // *****************************************************************************
10290 // *****************************************************************************
10291 // Section: DMA start/end functions
10292 // *****************************************************************************
10293 // *****************************************************************************
10294 //******************************************************************************
10295 /* Function:
10296  void PLIB_DMA_StartTransferSet ( DMA_MODULE_ID index,
10297  DMA_CHANNEL channel )
10298  Summary:
10299  Initiates transfer on the specified channel.
10300  Description:
10301  This function initiates transfer on the specified channel. This is a forced transfer
10302  controlled via software.
10303  Precondition:
10304  None.
10305  Parameters:
10306  channel - One of the possible DMA channels listed by DMA_CHANNEL
10307  Returns:
10308  None.
10309  Example:
10310  <code>
10311  PLIB_DMA_StartTransferSet ( DMA_ID_0,
10312  DMA_CHANNEL_4 );
10313  </code>
10314  Remarks:
10315  This function implements an operation of the StartTransfer feature.
10316  This feature may not be available on all devices. Please refer to the
10317  specific device data sheet to determine availability or use the
10318  PLIB_DMA_ExistsStartTransfer function in your application to automatically
10319  determine whether this feature is available.
10320 */
10321 
10322 void
10324  DMA_MODULE_ID index ,
10325  DMA_CHANNEL channel ) ;
10326 //******************************************************************************
10327 /* Function:
10328  void PLIB_DMA_AbortTransferSet ( DMA_MODULE_ID index,
10329  DMA_CHANNEL channel )
10330  Summary:
10331  Aborts transfer on the specified channel.
10332  Description:
10333  This function aborts transfer on the specified channel. This is a forced abort
10334  controlled via software.
10335  Precondition:
10336  None.
10337  Parameters:
10338  channel - One of the possible DMA channels listed by DMA_CHANNEL
10339  Returns:
10340  None.
10341  Example:
10342  <code>
10343  PLIB_DMA_AbortTransferSet ( DMA_ID_0,
10344  DMA_CHANNEL_4 );
10345  </code>
10346  Remarks:
10347  This function implements an operation of the AbortTransfer feature.
10348  This feature may not be available on all devices. Please refer to the
10349  specific device data sheet to determine availability or use the
10350  PLIB_DMA_ExistsAbortTransfer function in your application to automatically
10351  determine whether this feature is available.
10352 */
10353 
10354 void
10356  DMA_MODULE_ID index ,
10357  DMA_CHANNEL channel ) ;
10358 // *****************************************************************************
10359 // *****************************************************************************
10360 // Section: DMA General Configuration functions
10361 // *****************************************************************************
10362 // *****************************************************************************
10363 //******************************************************************************
10364 /* Function:
10365  void PLIB_DMA_BusyActiveSet ( DMA_MODULE_ID index )
10366  Summary:
10367  Sets the BUSY bit of the DMA controller.
10368  Description:
10369  This function sets the BUSY bit of the DMA controller. The DMA module is active.
10370  Precondition:
10371  None.
10372  Parameters:
10373  None.
10374  Returns:
10375  None.
10376  Example:
10377  <code>
10378  PLIB_DMA_BusyActiveSet( DMA_ID_0 );
10379  </code>
10380  Remarks:
10381  This function implements an operation of the Busy feature.
10382  This feature may not be available on all devices. Please refer to the
10383  specific device data sheet to determine availability or use the
10384  PLIB_DMA_ExistsBusy function in your application to automatically
10385  determine whether this feature is available.
10386 */
10387 
10388 void
10390  DMA_MODULE_ID index ) ;
10391 //******************************************************************************
10392 /* Function:
10393  void PLIB_DMA_BusyActiveReset ( DMA_MODULE_ID index )
10394  Summary:
10395  Resets the BUSY bit of the DMA controller.
10396  Description:
10397  This function resets the BUSY bit of the DMA controller. The DMA module is
10398  disabled and is not actively transferring data.
10399  Precondition:
10400  None.
10401  Parameters:
10402  None.
10403  Returns:
10404  None.
10405  Example:
10406  <code>
10407  PLIB_DMA_BusyActiveReset( DMA_ID_0 );
10408  </code>
10409  Remarks:
10410  This function implements an operation of the Busy feature.
10411  This feature may not be available on all devices. Please refer to the
10412  specific device data sheet to determine availability or use the
10413  PLIB_DMA_ExistsBusy function in your application to automatically
10414  determine whether this feature is available.
10415 */
10416 
10417 void
10419  DMA_MODULE_ID index ) ;
10420 //******************************************************************************
10421 /* Function:
10422  bool PLIB_DMA_IsBusy ( DMA_MODULE_ID index )
10423  Summary:
10424  Gets the BUSY bit of the DMA controller.
10425  Description:
10426  This function gets the BUSY bit of the DMA controller.
10427  Precondition:
10428  None.
10429  Parameters:
10430  None.
10431  Returns:
10432  - true - DMA module is active
10433  - false - DMA module is disabled and is not actively transferring data
10434  Example:
10435  <code>
10436  bool dmaBusyStatus;
10437  dmaBusyStatus = PLIB_DMA_IsBusy( DMA_ID_0 );
10438  </code>
10439  Remarks:
10440  This function implements an operation of the Busy feature.
10441  This feature may not be available on all devices. Please refer to the
10442  specific device data sheet to determine availability or use the
10443  PLIB_DMA_ExistsBusy function in your application to automatically
10444  determine whether this feature is available.
10445 */
10446 
10447 bool
10448  PLIB_DMA_IsBusy (
10449  DMA_MODULE_ID index ) ;
10450 //******************************************************************************
10451 /* Function:
10452  void PLIB_DMA_SuspendEnable ( DMA_MODULE_ID index )
10453  Summary:
10454  DMA transfers are suspended to allow uninterrupted access by the CPU to the data bus.
10455  Description:
10456  This function suspends the DMA transfers to allow uninterrupted access
10457  by the CPU to the data bus.
10458  Precondition:
10459  None.
10460  Parameters:
10461  None.
10462  Returns:
10463  None.
10464  Example:
10465  <code>
10466  PLIB_DMA_SuspendEnable( DMA_ID_0 );
10467  </code>
10468  Remarks:
10469  This function implements an operation of the Suspend feature.
10470  This feature may not be available on all devices. Please refer to the
10471  specific device data sheet to determine availability or use the
10472  PLIB_DMA_ExistsSuspend function in your application to automatically
10473  determine whether this feature is available.
10474 */
10475 
10476 void
10478  DMA_MODULE_ID index ) ;
10479 //******************************************************************************
10480 /* Function:
10481  void PLIB_DMA_SuspendDisable ( DMA_MODULE_ID index )
10482  Summary:
10483  DMA suspend is disabled and the DMA module operates normally.
10484  Description:
10485  This function disables the DMA suspend. The DMA module continues to operate
10486  normally.
10487  Precondition:
10488  None.
10489  Parameters:
10490  None.
10491  Returns:
10492  None.
10493  Example:
10494  <code>
10495  PLIB_DMA_SuspendDisable( DMA_ID_0 );
10496  </code>
10497  Remarks:
10498  This function implements an operation of the Suspend feature.
10499  This feature may not be available on all devices. Please refer to the
10500  specific device data sheet to determine availability or use the
10501  PLIB_DMA_ExistsSuspend function in your application to automatically
10502  determine whether this feature is available.
10503 */
10504 
10505 void
10507  DMA_MODULE_ID index ) ;
10508 //******************************************************************************
10509 /* Function:
10510  bool PLIB_DMA_SuspendIsEnabled ( DMA_MODULE_ID index )
10511  Summary:
10512  Returns the DMA suspend status.
10513  Description:
10514  This function returns the DMA suspend status.
10515  Precondition:
10516  None.
10517  Parameters:
10518  None.
10519  Returns:
10520  - true - The DMA transfers are suspended
10521  - false - The DMA operates normally
10522  Example:
10523  <code>
10524  bool dmaSuspendStatus;
10525  dmaSuspendStatus = PLIB_DMA_SuspendIsEnabled( DMA_ID_0 );
10526  </code>
10527  Remarks:
10528  This function implements an operation of the Suspend feature.
10529  This feature may not be available on all devices. Please refer to the
10530  specific device data sheet to determine availability or use the
10531  PLIB_DMA_ExistsSuspend function in your application to automatically
10532  determine whether this feature is available.
10533 */
10534 
10535 bool
10537  DMA_MODULE_ID index ) ;
10538 //******************************************************************************
10539 /* Function:
10540  void PLIB_DMA_StopInIdleEnable ( DMA_MODULE_ID index )
10541  Summary:
10542  DMA transfers are halted during Idle mode.
10543  Description:
10544  This function halts DMA transfers during Idle mode.
10545  Precondition:
10546  None.
10547  Parameters:
10548  None.
10549  Returns:
10550  None.
10551  Example:
10552  <code>
10553  PLIB_DMA_StopInIdleEnable( DMA_ID_0 );
10554  </code>
10555  Remarks:
10556  This function implements an operation of the StopInIdle feature.
10557  This feature may not be available on all devices. Please refer to the
10558  specific device data sheet to determine availability or use the
10559  PLIB_DMA_ExistsStopInIdle function in your application to automatically
10560  determine whether this feature is available.
10561 */
10562 
10563 void
10565  DMA_MODULE_ID index ) ;
10566 //******************************************************************************
10567 /* Function:
10568  void PLIB_DMA_StopInIdleDisable ( DMA_MODULE_ID index )
10569  Summary:
10570  DMA transfers continue during Idle mode.
10571  Description:
10572  This function causes DMA transfers to continue during Idle mode.
10573  Precondition:
10574  None.
10575  Parameters:
10576  None.
10577  Returns:
10578  None.
10579  Example:
10580  <code>
10581  PLIB_DMA_StopInIdleDisable( DMA_ID_0 );
10582  </code>
10583  Remarks:
10584  This function implements an operation of the StopInIdle feature.
10585  This feature may not be available on all devices. Please refer to the
10586  specific device data sheet to determine availability or use the
10587  PLIB_DMA_ExistsStopInIdle function in your application to automatically
10588  determine whether this feature is available.
10589 */
10590 
10591 void
10593  DMA_MODULE_ID index ) ;
10594 //******************************************************************************
10595 /* Function:
10596  void PLIB_DMA_Enable ( DMA_MODULE_ID index )
10597  Summary:
10598  DMA module is enabled.
10599  Description:
10600  This function enables the DMA module.
10601  Precondition:
10602  None.
10603  Parameters:
10604  None.
10605  Returns:
10606  None.
10607  Example:
10608  <code>
10609  PLIB_DMA_Enable( DMA_ID_0 );
10610  </code>
10611  Remarks:
10612  This function implements an operation of the EnableControl feature.
10613  This feature may not be available on all devices. Please refer to the
10614  specific device data sheet to determine availability or use the
10615  PLIB_DMA_ExistsEnableControl function in your application to automatically
10616  determine whether this feature is available.
10617 */
10618 
10619 void
10620  PLIB_DMA_Enable (
10621  DMA_MODULE_ID index ) ;
10622 //******************************************************************************
10623 /* Function:
10624  bool PLIB_DMA_IsEnabled ( DMA_MODULE_ID index )
10625  Summary:
10626  Returns the DMA module enable status.
10627  Description:
10628  This function returns the DMA module enable status.
10629  Precondition:
10630  None.
10631  Parameters:
10632  None.
10633  Returns:
10634  - true - The DMA is enabled
10635  - false - The DMA is disabled
10636  Example:
10637  <code>
10638  PLIB_DMA_IsEnabled( DMA_ID_0 );
10639  </code>
10640  Remarks:
10641  This function implements an operation of the EnableControl feature.
10642  This feature may not be available on all devices. Please refer to the
10643  specific device data sheet to determine availability or use the
10644  PLIB_DMA_ExistsEnableControl function in your application to automatically
10645  determine whether this feature is available.
10646 */
10647 
10648 bool
10650  DMA_MODULE_ID index ) ;
10651 //******************************************************************************
10652 /* Function:
10653  void PLIB_DMA_Disable ( DMA_MODULE_ID index )
10654  Summary:
10655  DMA module is disabled.
10656  Description:
10657  This function disables the DMA module.
10658  Precondition:
10659  None.
10660  Parameters:
10661  None.
10662  Returns:
10663  None.
10664  Example:
10665  <code>
10666  PLIB_DMA_Disable( DMA_ID_0 );
10667  </code>
10668  Remarks:
10669  This function implements an operation of the EnableControl feature.
10670  This feature may not be available on all devices. Please refer to the
10671  specific device data sheet to determine availability or use the
10672  PLIB_DMA_ExistsEnableControl function in your application to automatically
10673  determine whether this feature is available.
10674 */
10675 
10676 void
10678  DMA_MODULE_ID index ) ;
10679 // *****************************************************************************
10680 // *****************************************************************************
10681 // Section: DMA status functions
10682 // *****************************************************************************
10683 // *****************************************************************************
10684 //******************************************************************************
10685 /* Function:
10686  uint8_t PLIB_DMA_ChannelBitsGet ( DMA_MODULE_ID index )
10687  Summary:
10688  Returns the DMA channel bits.
10689  Description:
10690  This function returns the channel bits.
10691  Precondition:
10692  None.
10693  Parameters:
10694  None.
10695  Returns:
10696  - uint8_t - DMA channel bits
10697  Example:
10698  <code>
10699  uint8_t dmaChBits;
10700  dmaChBits = PLIB_DMA_ChannelBitsGet( DMA_ID_0 );
10701  </code>
10702  Remarks:
10703  This function implements an operation of the ChannelBits feature.
10704  This feature may not be available on all devices. Please refer to the
10705  specific device data sheet to determine availability or use the
10706  PLIB_DMA_ExistsChannelBits function in your application to automatically
10707  determine whether this feature is available.
10708 */
10709 
10710 uint8_t
10712  DMA_MODULE_ID index ) ;
10713 //******************************************************************************
10714 /* Function:
10715  bool PLIB_DMA_LastBusAccessIsRead ( DMA_MODULE_ID index )
10716  Summary:
10717  Returns true if the last DMA bus access was a read.
10718  Description:
10719  This function returns true if the last DMA bus access was a read.
10720  Precondition:
10721  None.
10722  Parameters:
10723  None.
10724  Returns:
10725  - true - The last bus access was a read
10726  - false - The last bus access was not a read
10727  Example:
10728  <code>
10729  bool dmaLastBusAccessType;
10730  dmaLastBusAccessType = PLIB_DMA_LastBusAccessIsRead( DMA_ID_0 );
10731  </code>
10732  Remarks:
10733  This function implements an operation of the LastBusAccess feature.
10734  This feature may not be available on all devices. Please refer to the
10735  specific device data sheet to determine availability or use the
10736  PLIB_DMA_ExistsLastBusAccess function in your application to automatically
10737  determine whether this feature is available.
10738 */
10739 
10740 bool
10742  DMA_MODULE_ID index ) ;
10743 //******************************************************************************
10744 /* Function:
10745  bool PLIB_DMA_LastBusAccessIsWrite ( DMA_MODULE_ID index )
10746  Summary:
10747  Returns true if the last DMA bus access was a write.
10748  Description:
10749  This function returns true if the last DMA bus access was a write operation.
10750  Precondition:
10751  None.
10752  Parameters:
10753  None.
10754  Returns:
10755  - true - The last bus access was a write operation
10756  - false - The last bus access was not a write operation
10757  Example:
10758  <code>
10759  bool dmaLastBusAccessType;
10760  dmaLastBusAccessType = PLIB_DMA_LastBusAccessIsWrite( DMA_ID_0 );
10761  </code>
10762  Remarks:
10763  This function implements an operation of the LastBusAccess feature.
10764  This feature may not be available on all devices. Please refer to the
10765  specific device data sheet to determine availability or use the
10766  PLIB_DMA_ExistsLastBusAccess function in your application to automatically
10767  determine whether this feature is available.
10768 */
10769 
10770 bool
10772  DMA_MODULE_ID index ) ;
10773 //******************************************************************************
10774 /* Function:
10775  uint32_t PLIB_DMA_RecentAddressAccessed ( DMA_MODULE_ID index )
10776  Summary:
10777  Returns the address of the most recent DMA access.
10778  Description:
10779  This function returns the address of the most recent DMA access.
10780  Precondition:
10781  None.
10782  Parameters:
10783  None.
10784  Returns:
10785  - uint32_t - The most recent address accessed by the DMA
10786  Example:
10787  <code>
10788  uint32_t dmaLastAddressAccessed;
10789  dmaLastAddressAccessed = PLIB_DMA_RecentAddressAccessed( DMA_ID_0 );
10790  </code>
10791  Remarks:
10792  This function implements an operation of the RecentAddress feature.
10793  This feature may not be available on all devices. Please refer to the
10794  specific device data sheet to determine availability or use the
10795  PLIB_DMA_ExistsRecentAddress function in your application to automatically
10796  determine whether this feature is available.
10797 */
10798 
10799 uint32_t
10801  DMA_MODULE_ID index ) ;
10802 // *****************************************************************************
10803 // *****************************************************************************
10804 // Section: DMA Module CRC Feature Interface Functions
10805 // *****************************************************************************
10806 // *****************************************************************************
10807 //******************************************************************************
10808 /* Function:
10809  void PLIB_DMA_CRCChannelSelect( DMA_MODULE_ID index,
10810  DMA_CHANNEL channel )
10811  Summary:
10812  Assigns the CRC to the specified DMA channel.
10813  Description:
10814  This function assigns the CRC feature to the specified channel.
10815  Precondition:
10816  None.
10817  Parameters:
10818  channel - One of the possible DMA channels listed by DMA_CHANNEL
10819  Returns:
10820  None.
10821  Example:
10822  <code>
10823  PLIB_DMA_CRCChannelSelect( DMA_ID_0,
10824  DMA_CHANNEL_5 );
10825  </code>
10826  Remarks:
10827  This function implements an operation of the CRCChannel feature.
10828  This feature may not be available on all devices. Please refer to the
10829  specific device data sheet to determine availability or use the
10830  PLIB_DMA_ExistsCRCChannel function in your application to automatically
10831  determine whether this feature is available.
10832 */
10833 
10834 void
10836  DMA_MODULE_ID index ,
10837  DMA_CHANNEL channel ) ;
10838 //******************************************************************************
10839 /* Function:
10840  DMA_CHANNEL PLIB_DMA_CRCChannelGet ( DMA_MODULE_ID index )
10841  Summary:
10842  Returns the current DMA channel to which the CRC is assigned.
10843  Description:
10844  This function returns the current DMA channel to which the CRC is assigned.
10845  Precondition:
10846  None.
10847  Parameters:
10848  None.
10849  Returns:
10850  crcChannel - One of the possible DMA channels listed by DMA_CHANNEL
10851  Example:
10852  <code>
10853  DMA_CHANNEL crcChannel;
10854  crcChannel = PLIB_DMA_CRCChannelGet( DMA_ID_0 );
10855  </code>
10856  Remarks:
10857  This function implements an operation of the CRCChannel feature.
10858  This feature may not be available on all devices. Please refer to the
10859  specific device data sheet to determine availability or use the
10860  PLIB_DMA_ExistsCRCChannel function in your application to automatically
10861  determine whether this feature is available.
10862 */
10863 
10864 DMA_CHANNEL
10866  DMA_MODULE_ID index ) ;
10867 //******************************************************************************
10868 /* Function:
10869  void PLIB_DMA_CRCTypeSet ( DMA_MODULE_ID index,
10870  DMA_CRC_TYPE CRCType )
10871  Summary:
10872  Selects the DMA module CRC feature type.
10873  Description:
10874  This function selects the DMA module CRC feature type. The CRC feature will
10875  compute either the IP header checksum or the Linear Shift Feedback Register (LFSR)
10876  checksum.
10877  Precondition:
10878  None.
10879  Parameters:
10880  CRCType - One of the possible CRC checksums listed by DMA_CRC_TYPE
10881  Returns:
10882  None.
10883  Example:
10884  <code>
10885  PLIB_DMA_CRCTypeSet(DMA_ID_0,
10886  DMA_CRC_IP_HEADER );
10887  </code>
10888  Remarks:
10889  This function implements an operation of the CRCType feature.
10890  This feature may not be available on all devices. Please refer to the
10891  specific device data sheet to determine availability or use the
10892  PLIB_DMA_ExistsCRCType function in your application to automatically
10893  determine whether this feature is available.
10894 */
10895 
10896 void
10898  DMA_MODULE_ID index ,
10899  DMA_CRC_TYPE CRCType ) ;
10900 //******************************************************************************
10901 /* Function:
10902  DMA_CRC_TYPE PLIB_DMA_CRCTypeGet ( DMA_MODULE_ID index )
10903  Summary:
10904  Gets the current DMA module CRC feature type.
10905  Description:
10906  This function gets the DMA module CRC feature type. The CRC feature will
10907  compute either the IP header checksum or the Linear Shift Feedback Register (LFSR)
10908  checksum.
10909  Precondition:
10910  None.
10911  Parameters:
10912  None.
10913  Returns:
10914  - CRCType - One of the possible CRC checksums listed by DMA_CRC_TYPE.
10915  Example:
10916  <code>
10917  DMA_CRC_TYPE CRCType;
10918  CRCType = PLIB_DMA_CRCTypeGet( DMA_ID_0 );
10919  </code>
10920  Remarks:
10921  This function implements an operation of the CRCType feature.
10922  This feature may not be available on all devices. Please refer to the
10923  specific device data sheet to determine availability or use the
10924  PLIB_DMA_ExistsCRCType function in your application to automatically
10925  determine whether this feature is available.
10926 */
10927 
10928 DMA_CRC_TYPE
10930  DMA_MODULE_ID index ) ;
10931 //******************************************************************************
10932 /* Function:
10933  void PLIB_DMA_CRCAppendModeEnable ( DMA_MODULE_ID index )
10934  Summary:
10935  Enables the CRC append mode.
10936  Description:
10937  This function enables the CRC append mode. The DMA transfers data from the source
10938  into the CRC, but not to the destination. When a block transfer completes, the
10939  DMA writes the calculated CRC value to the location specified by the CHxDSA register.
10940  Precondition:
10941  None.
10942  Parameters:
10943  None.
10944  Returns:
10945  None.
10946  Example:
10947  <code>
10948  PLIB_DMA_CRCAppendModeEnable( DMA_ID_0 );
10949  </code>
10950  Remarks:
10951  This function implements an operation of the CRCAppendMode feature.
10952  This feature may not be available on all devices. Please refer to the
10953  specific device data sheet to determine availability or use the
10954  PLIB_DMA_ExistsCRCAppendMode function in your application to automatically
10955  determine whether this feature is available.
10956 */
10957 
10958 void
10960  DMA_MODULE_ID index ) ;
10961 //******************************************************************************
10962 /* Function:
10963  bool PLIB_DMA_CRCAppendModeIsEnabled ( DMA_MODULE_ID index )
10964  Summary:
10965  Gets the enable status of the CRC append mode.
10966  Description:
10967  This function gets the enable status of the CRC append mode.
10968  Precondition:
10969  None.
10970  Parameters:
10971  None.
10972  Returns:
10973  - true - CRC append mode is enabled
10974  - false - CRC append mode is disabled
10975  Example:
10976  <code>
10977  bool DMAcrcAppendMode;
10978  DMAcrcAppendMode = PLIB_DMA_CRCAppendModeIsEnabled( DMA_ID_0 );
10979  </code>
10980  Remarks:
10981  This function implements an operation of the CRCAppendMode feature.
10982  This feature may not be available on all devices. Please refer to the
10983  specific device data sheet to determine availability or use the
10984  PLIB_DMA_ExistsCRCAppendMode function in your application to automatically
10985  determine whether this feature is available.
10986 */
10987 
10988 bool
10990  DMA_MODULE_ID index ) ;
10991 //******************************************************************************
10992 /* Function:
10993  void PLIB_DMA_CRCAppendModeDisable ( DMA_MODULE_ID index )
10994  Summary:
10995  Disables the CRC append mode.
10996  Description:
10997  This function disables the CRC append mode. The DMA transfers data from the
10998  source through the CRC obeying WBO (DMA_MODULE_ID index, write byte order)
10999  as it writes the data to the destination.
11000  Precondition:
11001  None.
11002  Parameters:
11003  None.
11004  Returns:
11005  None.
11006  Example:
11007  <code>
11008  PLIB_DMA_CRCAppendModeDisable( DMA_ID_0 );
11009  </code>
11010  Remarks:
11011  This function implements an operation of the CRCAppendMode feature.
11012  This feature may not be available on all devices. Please refer to the
11013  specific device data sheet to determine availability or use the
11014  PLIB_DMA_ExistsCRCAppendMode function in your application to automatically
11015  determine whether this feature is available.
11016 */
11017 
11018 void
11020  DMA_MODULE_ID index ) ;
11021 //******************************************************************************
11022 /* Function:
11023  void PLIB_DMA_CRCEnable ( DMA_MODULE_ID index )
11024  Summary:
11025  Enables the DMA module CRC feature.
11026  Description:
11027  This function enables the DMA module CRC feature. The channel transfers are
11028  routed through the CRC.
11029  Precondition:
11030  None.
11031  Parameters:
11032  None.
11033  Returns:
11034  None.
11035  Example:
11036  <code>
11037  PLIB_DMA_CRCEnable( DMA_ID_0 );
11038  </code>
11039  Remarks:
11040  This function implements an operation of the CRC feature.
11041  This feature may not be available on all devices. Please refer to the
11042  specific device data sheet to determine availability or use the
11043  PLIB_DMA_ExistsCRC function in your application to automatically
11044  determine whether this feature is available.
11045 */
11046 
11047 void
11049  DMA_MODULE_ID index ) ;
11050 //******************************************************************************
11051 /* Function:
11052  bool PLIB_DMA_CRCIsEnabled ( DMA_MODULE_ID index )
11053  Summary:
11054  Gets the enable status of the CRC feature.
11055  Description:
11056  This function gets the enable status of the CRC feature.
11057  Precondition:
11058  None.
11059  Parameters:
11060  None.
11061  Returns:
11062  - true - The CRC feature is enabled
11063  - false - The CRC feature is disabled
11064  Example:
11065  <code>
11066  bool DMAcrcStatus;
11067  DMAcrcStatus = PLIB_DMA_CRCIsEnabled( DMA_ID_0 );
11068  </code>
11069  Remarks:
11070  This function implements an operation of the CRC feature.
11071  This feature may not be available on all devices. Please refer to the
11072  specific device data sheet to determine availability or use the
11073  PLIB_DMA_ExistsCRC function in your application to automatically
11074  determine whether this feature is available.
11075 */
11076 
11077 bool
11079  DMA_MODULE_ID index ) ;
11080 //******************************************************************************
11081 /* Function:
11082  void PLIB_DMA_CRCDisable ( DMA_MODULE_ID index )
11083  Summary:
11084  Disables the DMA module CRC feature.
11085  Description:
11086  This function disables the DMA module CRC feature. The channel transfers proceed
11087  normally.
11088  Precondition:
11089  None.
11090  Parameters:
11091  None.
11092  Returns:
11093  None.
11094  Example:
11095  <code>
11096  PLIB_DMA_CRCDisable( DMA_ID_0 );
11097  </code>
11098  Remarks:
11099  This function implements an operation of the CRC feature.
11100  This feature may not be available on all devices. Please refer to the
11101  specific device data sheet to determine availability or use the
11102  PLIB_DMA_ExistsCRC function in your application to automatically
11103  determine whether this feature is available.
11104 */
11105 
11106 void
11108  DMA_MODULE_ID index ) ;
11109 //******************************************************************************
11110 /* Function:
11111  void PLIB_DMA_CRCPolynomialLengthSet ( DMA_MODULE_ID index,
11112  uint8_t polyLength )
11113  Summary:
11114  Selects the polynomial length.
11115  Description:
11116  This function Selects the polynomial length.
11117  Precondition:
11118  None.
11119  Parameters:
11120  polyLength - Polynomial length
11121  Returns:
11122  None.
11123  Example:
11124  <code>
11125  uint8_t polyLength = 0x2;
11126  PLIB_DMA_CRCPolynomialLengthSet( DMA_ID_0, polyLength );
11127  </code>
11128  Remarks:
11129  This function implements an operation of the CRCPolynomialLength feature.
11130  This feature may not be available on all devices. Please refer to the
11131  specific device data sheet to determine availability or use the
11132  PLIB_DMA_ExistsCRCPolynomialLength function in your application to automatically
11133  determine whether this feature is available.
11134 */
11135 
11136 void
11138  DMA_MODULE_ID index ,
11139  uint8_t polyLength ) ;
11140 //******************************************************************************
11141 /* Function:
11142  uint8_t PLIB_DMA_CRCPolynomialLengthGet ( DMA_MODULE_ID index )
11143  Summary:
11144  Gets the current polynomial length.
11145  Description:
11146  This function gets the current polynomial length.
11147  Precondition:
11148  None.
11149  Parameters:
11150  None.
11151  Returns:
11152  - uint8_t - Polynomial length
11153  Example:
11154  <code>
11155  uint8_t polyLength;
11156  polyLength = PLIB_DMA_CRCPolynomialLengthGet( DMA_ID_0 );
11157  </code>
11158  Remarks:
11159  This function implements an operation of the CRCPolynomialLength feature.
11160  This feature may not be available on all devices. Please refer to the
11161  specific device data sheet to determine availability or use the
11162  PLIB_DMA_ExistsCRCPolynomialLength function in your application to automatically
11163  determine whether this feature is available.
11164 */
11165 
11166 uint8_t
11168  DMA_MODULE_ID index ) ;
11169 //******************************************************************************
11170 /* Function:
11171  void PLIB_DMA_CRCBitOrderSelect ( DMA_MODULE_ID index,
11172  DMA_CRC_BIT_ORDER bitOrder )
11173  Summary:
11174  Selects the bit order for checksum calculation.
11175  Description:
11176  This function selects the bit order for checksum calculation.
11177  Precondition:
11178  None.
11179  Parameters:
11180  bitOrder - Specifies the bit order for CRC calculation
11181  Returns:
11182  None.
11183  Example:
11184  <code>
11185  PLIB_DMA_CRCBitOrderSelect ( DMA_ID_0,DMA_CRC_BIT_ORDER_LSB );
11186  </code>
11187  Remarks:
11188  This function implements an operation of the CRCBitOrder feature.
11189  This feature may not be available on all devices. Please refer to the
11190  specific device data sheet to determine availability or use the
11191  PLIB_DMA_ExistsCRCBitOrder function in your application to automatically
11192  determine whether this feature is available.
11193 */
11194 
11195 void
11197  DMA_MODULE_ID index ,
11198  DMA_CRC_BIT_ORDER bitOrder ) ;
11199 //******************************************************************************
11200 /* Function:
11201  void PLIB_DMA_CRCWriteByteOrderAlter ( DMA_MODULE_ID index )
11202  Summary:
11203  The source data is written to the destination reordered as defined by the
11204  BYTO<1:0> bits.
11205  Description:
11206  This function enables byte order alteration as specified by the BYTO<1:0> bits.
11207  The source data is written to the destination reordered as defined by the
11208  BYTO<1:0> bits.
11209  Precondition:
11210  None.
11211  Parameters:
11212  None.
11213  Returns:
11214  None.
11215  Example:
11216  <code>
11217  PLIB_DMA_CRCWriteByteOrderAlter ( DMA_ID_0 );
11218  </code>
11219  Remarks:
11220  This function implements an operation of the CRCWriteByteOrder feature.
11221  This feature may not be available on all devices. Please refer to the
11222  specific device data sheet to determine availability or use the
11223  PLIB_DMA_ExistsCRCWriteByteOrder function in your application to automatically
11224  determine whether this feature is available.
11225 */
11226 
11227 void
11229  DMA_MODULE_ID index ) ;
11230 //******************************************************************************
11231 /* Function:
11232  void PLIB_DMA_CRCWriteByteOrderMaintain ( DMA_MODULE_ID index )
11233  Summary:
11234  The source data is written to the destination unaltered.
11235  Description:
11236  This function disables byte order alteration. The source data is written
11237  to the destination unaltered.
11238  Precondition:
11239  None.
11240  Parameters:
11241  None.
11242  Returns:
11243  None.
11244  Example:
11245  <code>
11246  PLIB_DMA_CRCWriteByteOrderMaintain ( DMA_ID_0 );
11247  </code>
11248  Remarks:
11249  This function implements an operation of the CRCWriteByteOrder feature.
11250  This feature may not be available on all devices. Please refer to the
11251  specific device data sheet to determine availability or use the
11252  PLIB_DMA_ExistsCRCWriteByteOrder function in your application to automatically
11253  determine whether this feature is available.
11254 */
11255 
11256 void
11258  DMA_MODULE_ID index ) ;
11259 //******************************************************************************
11260 /* Function:
11261  void PLIB_DMA_CRCByteOrderSelect ( DMA_MODULE_ID index,
11262  DMA_CRC_BYTE_ORDER byteOrder )
11263  Summary:
11264  Selects the byte order.
11265  Description:
11266  This function selects the byte order.
11267  Precondition:
11268  The WBO bit must be set to use this function.
11269  Parameters:
11270  byteOrder - One of the possible byte orders specified by DMA_CRC_BYTE_ORDER
11271  Returns:
11272  None.
11273  Example:
11274  <code>
11275  PLIB_DMA_CRCByteOrderSelect ( DMA_ID_0,
11276  DMA_CRC_SWAP_HALF_WORD_ON_WORD_BOUNDARY );
11277  </code>
11278  Remarks:
11279  This function implements an operation of the CRCByteOrder feature.
11280  This feature may not be available on all devices. Please refer to the
11281  specific device data sheet to determine availability or use the
11282  PLIB_DMA_ExistsCRCByteOrder function in your application to automatically
11283  determine whether this feature is available.
11284 */
11285 
11286 void
11288  DMA_MODULE_ID index ,
11289  DMA_CRC_BYTE_ORDER byteOrder ) ;
11290 //******************************************************************************
11291 /* Function:
11292  DMA_CRC_BYTE_ORDER PLIB_DMA_CRCByteOrderGet ( DMA_MODULE_ID index )
11293  Summary:
11294  Gets the current byte order selected by the DMA module CRC feature.
11295  Description:
11296  This function gets the current byte order selected by the DMA module CRC feature.
11297  Precondition:
11298  The WBO bit must be set to use this function.
11299  Parameters:
11300  None.
11301  Returns:
11302  - byteOrder - One of the possible byte orders specified by DMA_CRC_BYTE_ORDER
11303  Example:
11304  <code>
11305  DMA_CRC_BYTE_ORDER byteOrder;
11306  byteOrder = PLIB_DMA_CRCByteOrderGet ( DMA_ID_0 );
11307  </code>
11308  Remarks:
11309  This function implements an operation of the CRCByteOrder feature.
11310  This feature may not be available on all devices. Please refer to the
11311  specific device data sheet to determine availability or use the
11312  PLIB_DMA_ExistsCRCByteOrder function in your application to automatically
11313  determine whether this feature is available.
11314 */
11315 
11316 DMA_CRC_BYTE_ORDER
11318  DMA_MODULE_ID index ) ;
11319 //******************************************************************************
11320 /* Function:
11321  uint32_t PLIB_DMA_CRCDataRead ( DMA_MODULE_ID index )
11322  Summary:
11323  Reads the contents of the DMA CRC data register.
11324  Description:
11325  This function reads the contents of the DMA CRC data register.
11326  Precondition:
11327  None.
11328  Parameters:
11329  None.
11330  Returns:
11331  - uint32_t - 32-bit CRC data
11332  The CRC data (16-bit, 32-bit) is device-specific. Please refer to the specific
11333  device data sheet to determine availability.
11334  Example:
11335  <code>
11336  uint32_t DMACRCdata;
11337  DMACRCdata = PLIB_DMA_CRCDataRead ( DMA_ID_0 );
11338  </code>
11339  Remarks:
11340  This function implements an operation of the CRCData feature.
11341  This feature may not be available on all devices. Please refer to the
11342  specific device data sheet to determine availability or use the
11343  PLIB_DMA_ExistsCRCData function in your application to automatically
11344  determine whether this feature is available.
11345 */
11346 
11347 uint32_t
11349  DMA_MODULE_ID index ) ;
11350 //******************************************************************************
11351 /* Function:
11352  void PLIB_DMA_CRCDataWrite ( DMA_MODULE_ID index,
11353  uint32_t DMACRCdata )
11354  Summary:
11355  Writes the contents of the DMA CRC data register with the specified data.
11356  Description:
11357  This function writes the contents of the DMA CRC data register.
11358  Precondition:
11359  None.
11360  Parameters:
11361  - DMACRCdata - 32-bit CRC data
11362  The CRC data (16-bit, 32-bit) is device-specific. Please refer to the specific
11363  device data sheet to determine availability.
11364  Returns:
11365  None.
11366  Example:
11367  <code>
11368  uint32_t DMACRCdata = 0x0E0E0E;
11369  PLIB_DMA_CRCDataWrite ( DMA_ID_0, DMACRCdata );
11370  </code>
11371  Remarks:
11372  This function implements an operation of the CRCData feature.
11373  This feature may not be available on all devices. Please refer to the
11374  specific device data sheet to determine availability or use the
11375  PLIB_DMA_ExistsCRCData function in your application to automatically
11376  determine whether this feature is available.
11377 */
11378 
11379 void
11381  DMA_MODULE_ID index ,
11382  uint32_t DMACRCdata ) ;
11383 //******************************************************************************
11384 /* Function:
11385  uint32_t PLIB_DMA_CRCXOREnableGet ( DMA_MODULE_ID index )
11386  Summary:
11387  Reads the CRC XOR register.
11388  Description:
11389  This function reads the CRC XOR register.
11390  Precondition:
11391  None.
11392  Parameters:
11393  None.
11394  Returns:
11395  - uint32_t - 32-bit CRC XOR enable mask data
11396  The CRC data (16-bit, 32-bit) is device-specific. Please refer to the specific
11397  device data sheet to determine availability.
11398  Example:
11399  <code>
11400  uint32_t DMACRCXORdata;
11401  DMACRCXORdata = PLIB_DMA_CRCXOREnableGet ( DMA_ID_0 );
11402  </code>
11403  Remarks:
11404  This function implements an operation of the CRCXOREnable feature.
11405  This feature may not be available on all devices. Please refer to the
11406  specific device data sheet to determine availability or use the
11407  PLIB_DMA_ExistsCRCXOREnable function in your application to automatically
11408  determine whether this feature is available.
11409 */
11410 
11411 uint32_t
11413  DMA_MODULE_ID index ) ;
11414 //******************************************************************************
11415 /* Function:
11416  void PLIB_DMA_CRCXOREnableSet ( DMA_MODULE_ID index,
11417  uint32_t DMACRCXOREnableMask )
11418  Summary:
11419  Writes to the CRC XOR enable register as per the specified enable mask.
11420  Description:
11421  This function writes to the CRC XOR enable register as per the specified
11422  enable mask. Each enabled bit will be taken as input to the shift register.
11423  Precondition:
11424  None.
11425  Parameters:
11426  - DMACRCXOREnableMask - 32-bit CRC XOR enable mask data
11427  The CRC data (16-bit, 32-bit) is device-specific. Please refer to the specific
11428  device data sheet to determine availability.
11429  Returns:
11430  None.
11431  Example:
11432  <code>
11433  uint32_t DMACRCXOREnableMask = 0x05EFFFFF;
11434  PLIB_DMA_CRCXOREnableSet ( DMA_ID_0, DMACRCXOREnableMask );
11435  </code>
11436  Remarks:
11437  This function implements an operation of the CRCXOREnable feature.
11438  This feature may not be available on all devices. Please refer to the
11439  specific device data sheet to determine availability or use the
11440  PLIB_DMA_ExistsCRCXOREnable function in your application to automatically
11441  determine whether this feature is available.
11442 */
11443 
11444 void
11446  DMA_MODULE_ID index ,
11447  uint32_t DMACRCXOREnableMask ) ;
11448 // *****************************************************************************
11449 // *****************************************************************************
11450 // Section: DMA Address control Interface functions
11451 // *****************************************************************************
11452 // *****************************************************************************
11453 //******************************************************************************
11454 /* Function:
11455  uint32_t PLIB_DMA_ChannelXSourceStartAddressGet ( DMA_MODULE_ID index,
11456  DMA_CHANNEL dmaChannel )
11457  Summary:
11458  Reads the source start address configured for the specified channel.
11459  Description:
11460  This function reads the source start address configured for the specified
11461  channel.
11462  Precondition:
11463  None.
11464  Parameters:
11465  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11466  Returns:
11467  - uint32_t - The source start address configured for this channel
11468  Example:
11469  <code>
11470  DMA_CHANNEL spiDMAChannel = DMA_CHANNEL_2;
11471  uint32_t SourceStartAddress;
11472  SourceStartAddress = PLIB_DMA_ChannelXSourceStartAddressGet(DMA_ID_0,
11473  spiDMAChannel );
11474  </code>
11475  Remarks:
11476  This function implements an operation of the ChannelXSourceStartAddress feature.
11477  This feature may not be available on all devices. Please refer to the
11478  specific device data sheet to determine availability or use the
11479  PLIB_DMA_ExistsChannelXSourceStartAddress function in your application to automatically
11480  determine whether this feature is available.
11481 */
11482 
11483 uint32_t
11485  DMA_MODULE_ID index ,
11486  DMA_CHANNEL dmaChannel ) ;
11487 //******************************************************************************
11488 /* Function:
11489  void PLIB_DMA_ChannelXSourceStartAddressSet ( DMA_MODULE_ID index,
11490  DMA_CHANNEL dmaChannel,
11491  uint32_t sourceStartAddress)
11492  Summary:
11493  Writes the specified source start address into the register
11494  corresponding to the specified channel.
11495  Description:
11496  This function writes the specified Source start address into the register
11497  corresponding to the specified channel.
11498  Precondition:
11499  None.
11500  Parameters:
11501  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11502  sourceStartAddress - The source start address
11503  Returns:
11504  None.
11505  Example:
11506  <code>
11507  DMA_CHANNEL spiDMAChannel = DMA_CHANNEL_2;
11508  uint32_t sourceStartAddress = 0x00FDEA00;
11509  PLIB_DMA_ChannelXSourceStartAddressSet ( DMA_ID_0,
11510  spiDMAChannel,
11511  sourceStartAddress );
11512  </code>
11513  Remarks:
11514  This function implements an operation of the ChannelXSourceStartAddress feature.
11515  This feature may not be available on all devices. Please refer to the
11516  specific device data sheet to determine availability or use the
11517  PLIB_DMA_ExistsChannelXSourceStartAddress function in your application to automatically
11518  determine whether this feature is available.
11519 */
11520 
11521 void
11523  DMA_MODULE_ID index ,
11524  DMA_CHANNEL dmaChannel ,
11525  uint32_t sourceStartAddress ) ;
11526 //******************************************************************************
11527 /* Function:
11528  uint32_t PLIB_DMA_ChannelXDestinationStartAddressGet ( DMA_MODULE_ID index,
11529  DMA_CHANNEL dmaChannel )
11530  Summary:
11531  Reads the destination start address configured for the specified channel.
11532  Description:
11533  This function reads the destination start address configured for the specified
11534  channel.
11535  Precondition:
11536  None.
11537  Parameters:
11538  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11539  Returns:
11540  - uint32_t - The destination start address configured for this channel
11541  Example:
11542  <code>
11543  DMA_CHANNEL spiDMAChannel = DMA_CHANNEL_2;
11544  uint32_t DestinationStartAddress;
11545  DestinationStartAddress = PLIB_DMA_ChannelXDestinationStartAddressGet (
11546  DMA_ID_0,
11547  spiDMAChannel );
11548  </code>
11549  Remarks:
11550  This function implements an operation of the ChannelXDestinationStartAddress feature.
11551  This feature may not be available on all devices. Please refer to the
11552  specific device data sheet to determine availability or use the
11553  PLIB_DMA_ExistsChannelXDestinationStartAddress function in your application to automatically
11554  determine whether this feature is available.
11555 */
11556 
11557 uint32_t
11559  DMA_MODULE_ID index ,
11560  DMA_CHANNEL dmaChannel ) ;
11561 //******************************************************************************
11562 /* Function:
11563  void PLIB_DMA_ChannelXDestinationStartAddressSet (
11564  DMA_MODULE_ID index,
11565  DMA_CHANNEL dmaChannel,
11566  uint32_t destinationStartAddress)
11567  Summary:
11568  Writes the specified destination start address into the register corresponding to
11569  the specified channel.
11570  Description:
11571  This function writes the specified destination start address into the register
11572  corresponding to the specified channel.
11573  Precondition:
11574  None.
11575  Parameters:
11576  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11577  destinationStartAddress - The destination start address
11578  Returns:
11579  None.
11580  Example:
11581  <code>
11582  DMA_CHANNEL spiDMAChannel = DMA_CHANNEL_2;
11583  uint32_t destinationStartAddress = 0x00FDEA00;
11584  PLIB_DMA_ChannelXDestinationStartAddressSet( DMA_ID_0,
11585  spiDMAChannel,
11586  destinationStartAddress );
11587  </code>
11588  Remarks:
11589  This function implements an operation of the ChannelXDestinationStartAddress feature.
11590  This feature may not be available on all devices. Please refer to the
11591  specific device data sheet to determine availability or use the
11592  PLIB_DMA_ExistsChannelXDestinationStartAddress function in your application to automatically
11593  determine whether this feature is available.
11594 */
11595 
11596 void
11598  DMA_MODULE_ID index ,
11599  DMA_CHANNEL dmaChannel ,
11600  uint32_t destinationStartAddress ) ;
11601 // *****************************************************************************
11602 // *****************************************************************************
11603 // Section: DMA Data control Interface functions
11604 // *****************************************************************************
11605 // *****************************************************************************
11606 //******************************************************************************
11607 /* Function:
11608  uint16_t PLIB_DMA_ChannelXSourceSizeGet ( DMA_MODULE_ID index,
11609  DMA_CHANNEL dmaChannel )
11610  Summary:
11611  Reads the source size configured for the specified channel.
11612  Description:
11613  This function reads the source size configured for the specified
11614  channel.
11615  Precondition:
11616  None.
11617  Parameters:
11618  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11619  Returns:
11620  - uint16_t - The Source size configured (in bytes) for this channel.
11621  The source size (8-bit, 16-bit) is device-specific. Please refer to the specific
11622  device data sheet to determine availability.
11623  Example:
11624  <code>
11625  DMA_CHANNEL spiDMAChannel = DMA_CHANNEL_2;
11626  uint16_t sourceSize;
11627  sourceSize = PLIB_DMA_ChannelXSourceSizeGet ( DMA_ID_0,
11628  spiDMAChannel );
11629  </code>
11630  Remarks:
11631  This function implements an operation of the ChannelXSourceSize feature.
11632  This feature may not be available on all devices. Please refer to the
11633  specific device data sheet to determine availability or use the
11634  PLIB_DMA_ExistsChannelXSourceSize function in your application to automatically
11635  determine whether this feature is available.
11636 */
11637 
11638 uint16_t
11640  DMA_MODULE_ID index ,
11641  DMA_CHANNEL dmaChannel ) ;
11642 //******************************************************************************
11643 /* Function:
11644  void PLIB_DMA_ChannelXSourceSizeSet ( DMA_MODULE_ID index,
11645  DMA_CHANNEL dmaChannel,
11646  uint16_t sourceSize)
11647  Summary:
11648  Writes the specified source size into the register corresponding
11649  to the specified channel.
11650  Description:
11651  This function writes the specified source size into the register
11652  corresponding to the specified channel.
11653  Precondition:
11654  None.
11655  Parameters:
11656  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11657  sourceSize - The source size. The source size (8-bit, 16-bit) is
11658  device-specific. Please refer to the specific device data
11659  sheet to determine availability.
11660  Returns:
11661  None.
11662  Example:
11663  <code>
11664  DMA_CHANNEL spiDMAChannel = DMA_CHANNEL_2;
11665  uint16_t sourceSize = 0xA00;
11666  PLIB_DMA_ChannelXSourceSizeSet ( DMA_ID_0,
11667  spiDMAChannel,
11668  sourceSize );
11669  </code>
11670  Remarks:
11671  This function implements an operation of the ChannelXSourceSize feature.
11672  This feature may not be available on all devices. Please refer to the
11673  specific device data sheet to determine availability or use the
11674  PLIB_DMA_ExistsChannelXSourceSize function in your application to automatically
11675  determine whether this feature is available.
11676 */
11677 
11678 void
11680  DMA_MODULE_ID index ,
11681  DMA_CHANNEL dmaChannel ,
11682  uint16_t sourceSize ) ;
11683 //******************************************************************************
11684 /* Function:
11685  uint16_t PLIB_DMA_ChannelXDestinationSizeGet ( DMA_MODULE_ID index,
11686  DMA_CHANNEL dmaChannel )
11687  Summary:
11688  Reads the destination size configured for the specified channel.
11689  Description:
11690  This function reads the destination size configured for the specified
11691  channel.
11692  Precondition:
11693  None.
11694  Parameters:
11695  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11696  Returns:
11697  - uint16_t - The destination size configured (in bytes) for this channel.
11698  The destination size (8-bit, 16-bit) is device-specific. Please refer to the specific
11699  device data sheet to determine availability.
11700  Example:
11701  <code>
11702  DMA_CHANNEL spiDMAChannel = DMA_CHANNEL_2;
11703  uint16_t DestinationSize;
11704  DestinationSize = PLIB_DMA_ChannelXDestinationSizeGet ( DMA_ID_0,
11705  spiDMAChannel );
11706  </code>
11707  Remarks:
11708  This function implements an operation of the ChannelXDestinationSize feature.
11709  This feature may not be available on all devices. Please refer to the
11710  specific device data sheet to determine availability or use the
11711  PLIB_DMA_ExistsChannelXDestinationSize function in your application to automatically
11712  determine whether this feature is available.
11713 */
11714 
11715 uint16_t
11717  DMA_MODULE_ID index ,
11718  DMA_CHANNEL dmaChannel ) ;
11719 //******************************************************************************
11720 /* Function:
11721  void PLIB_DMA_ChannelXDestinationSizeSet ( DMA_MODULE_ID index,
11722  DMA_CHANNEL dmaChannel,
11723  uint16_t destinationSize)
11724  Summary:
11725  Writes the specified destination size into the register corresponding
11726  to the specified channel.
11727  Description:
11728  This function writes the specified destination size into the register
11729  corresponding to the specified channel.
11730  Precondition:
11731  None.
11732  Parameters:
11733  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11734  destinationSize - The destination size. The destination size (8-bit, 16-bit)
11735  is device-specific. Please refer to the specific device
11736  data sheet to determine availability.)
11737  Returns:
11738  None.
11739  Example:
11740  <code>
11741  DMA_CHANNEL spiDMAChannel = DMA_CHANNEL_2;
11742  uint16_t destinationSize = 0xA00;
11743  PLIB_DMA_ChannelXDestinationSizeSet( DMA_ID_0, spiDMAChannel, destinationSize );
11744  </code>
11745  Remarks:
11746  This function implements an operation of the ChannelXDestinationSize feature.
11747  This feature may not be available on all devices. Please refer to the
11748  specific device data sheet to determine availability or use the
11749  PLIB_DMA_ExistsChannelXDestinationSize function in your application to automatically
11750  determine whether this feature is available.
11751 */
11752 
11753 void
11755  DMA_MODULE_ID index ,
11756  DMA_CHANNEL dmaChannel ,
11757  uint16_t destinationSize ) ;
11758 //******************************************************************************
11759 /* Function:
11760  uint16_t PLIB_DMA_ChannelXSourcePointerGet ( DMA_MODULE_ID index,
11761  DMA_CHANNEL dmaChannel )
11762  Summary:
11763  Reads the current byte of the source being pointed to for the specified channel.
11764  Description:
11765  This function reads the current byte of the source being pointed to for the
11766  specified channel.
11767  Precondition:
11768  None.
11769  Parameters:
11770  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11771  Returns:
11772  - uint16_t - The source byte being pointed to for this channel.
11773  The source pointer (8-bit, 16-bit) is device-specific. Please refer to the specific
11774  device data sheet to determine availability.
11775  Example:
11776  <code>
11777  DMA_CHANNEL spiDMAChannel = DMA_CHANNEL_2;
11778  uint16_t sourcebyte;
11779  sourcebyte = PLIB_DMA_ChannelXSourcePointerGet ( DMA_ID_0, spiDMAChannel );
11780  </code>
11781  Remarks:
11782  This function implements an operation of the ChannelXSourcePointer feature.
11783  This feature may not be available on all devices. Please refer to the
11784  specific device data sheet to determine availability or use the
11785  PLIB_DMA_ExistsChannelXSourcePointer function in your application to automatically
11786  determine whether this feature is available.
11787 */
11788 
11789 uint16_t
11791  DMA_MODULE_ID index ,
11792  DMA_CHANNEL dmaChannel ) ;
11793 //******************************************************************************
11794 /* Function:
11795  uint16_t PLIB_DMA_ChannelXDestinationPointerGet ( DMA_MODULE_ID index,
11796  DMA_CHANNEL dmaChannel )
11797  Summary:
11798  Reads the current byte of the destination being pointed to for the specified channel.
11799  Description:
11800  This function reads the current byte of the destination being pointed to for the
11801  specified channel.
11802  Precondition:
11803  None.
11804  Parameters:
11805  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11806  Returns:
11807  - uint16_t - The destination byte being pointed to for this channel.
11808  The destination pointer (8-bit, 16-bit) is device-specific. Please refer to the specific
11809  device data sheet to determine availability.
11810  Example:
11811  <code>
11812  DMA_CHANNEL spiDMAChannel = DMA_CHANNEL_2;
11813  uint16_t destinationbyte;
11814  destinationbyte = PLIB_DMA_ChannelXDestinationPointerGet ( DMA_ID_0,
11815  spiDMAChannel );
11816  </code>
11817  Remarks:
11818  This function implements an operation of the ChannelXDestinationPointer feature.
11819  This feature may not be available on all devices. Please refer to the
11820  specific device data sheet to determine availability or use the
11821  PLIB_DMA_ExistsChannelXDestinationPointer function in your application to automatically
11822  determine whether this feature is available.
11823 */
11824 
11825 uint16_t
11827  DMA_MODULE_ID index ,
11828  DMA_CHANNEL dmaChannel ) ;
11829 //******************************************************************************
11830 /* Function:
11831  uint16_t PLIB_DMA_ChannelXCellSizeGet ( DMA_MODULE_ID index,
11832  DMA_CHANNEL dmaChannel )
11833  Summary:
11834  Reads the cell size (in bytes) configured for the specified channel.
11835  Description:
11836  This function reads the cell size (in bytes) configured for the specified
11837  channel.
11838  Precondition:
11839  None.
11840  Parameters:
11841  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11842  Returns:
11843  - uint16_t - The cell size configured (in bytes) for this channel
11844  The cell size (8-bit, 16-bit) is device-specific. Please refer to the specific
11845  device data sheet to determine availability.
11846  Example:
11847  <code>
11848  DMA_CHANNEL spiDMAChannel = DMA_CHANNEL_2;
11849  uint16_t cellSize;
11850  cellSize = PLIB_DMA_ChannelXCellSizeGet ( DMA_ID_0,
11851  spiDMAChannel );
11852  </code>
11853  Remarks:
11854  This function implements an operation of the ChannelXCellSize feature.
11855  This feature may not be available on all devices. Please refer to the
11856  specific device data sheet to determine availability or use the
11857  PLIB_DMA_ExistsChannelXCellSize function in your application to automatically
11858  determine whether this feature is available.
11859 */
11860 
11861 uint16_t
11863  DMA_MODULE_ID index ,
11864  DMA_CHANNEL dmaChannel ) ;
11865 //******************************************************************************
11866 /* Function:
11867  void PLIB_DMA_ChannelXCellSizeSet ( DMA_MODULE_ID index,
11868  DMA_CHANNEL dmaChannel,
11869  uint16_t cellSize)
11870  Summary:
11871  Writes the specified cell size into the register corresponding
11872  to the specified channel.
11873  Description:
11874  This function writes the specified cell size into the register
11875  corresponding to the specified channel.
11876  Precondition:
11877  None.
11878  Parameters:
11879  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11880  cellSize - The cell size in bytes. The cell size (8-bit, 16-bit) is
11881  device-specific. Please refer to the specific device data
11882  sheet to determine availability.)
11883  Returns:
11884  None.
11885  Example:
11886  <code>
11887  DMA_CHANNEL spiDMAChannel = DMA_CHANNEL_2;
11888  uint16_t cellSize = 0x10;
11889  PLIB_DMA_ChannelXCellSizeSet ( DMA_ID_0, spiDMAChannel, cellSize );
11890  </code>
11891  Remarks:
11892  This function implements an operation of the ChannelXCellSize feature.
11893  This feature may not be available on all devices. Please refer to the
11894  specific device data sheet to determine availability or use the
11895  PLIB_DMA_ExistsChannelXCellSize function in your application to automatically
11896  determine whether this feature is available.
11897 */
11898 
11899 void
11901  DMA_MODULE_ID index ,
11902  DMA_CHANNEL dmaChannel ,
11903  uint16_t CellSize ) ;
11904 //******************************************************************************
11905 /* Function:
11906  uint16_t PLIB_DMA_ChannelXCellProgressPointerGet ( DMA_MODULE_ID index,
11907  DMA_CHANNEL dmaChannel )
11908  Summary:
11909  Returns the number of bytes transferred since the last event.
11910  Description:
11911  This function returns the number of bytes transferred since the last event.
11912  Precondition:
11913  None.
11914  Parameters:
11915  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11916  Returns:
11917  - uint16_t - The number of bytes transferred since the last event.
11918  The cell progress pointer (8-bit, 16-bit) is device-specific. Please refer to
11919  the specific device data sheet to determine availability.
11920  Example:
11921  <code>
11922  DMA_CHANNEL spiDMAChannel = DMA_CHANNEL_2;
11923  uint16_t CellProgress;
11924  CellProgress = PLIB_DMA_ChannelXCellProgressPointerGet ( DMA_ID_0,
11925  spiDMAChannel );
11926  </code>
11927  Remarks:
11928  This function implements an operation of the ChannelXCellProgressPointer feature.
11929  This feature may not be available on all devices. Please refer to the
11930  specific device data sheet to determine availability or use the
11931  PLIB_DMA_ExistsChannelXCellProgressPointer function in your application to automatically
11932  determine whether this feature is available.
11933 */
11934 
11935 uint16_t
11937  DMA_MODULE_ID index ,
11938  DMA_CHANNEL dmaChannel ) ;
11939 //******************************************************************************
11940 /* Function:
11941  uint16_t PLIB_DMA_ChannelXPatternDataGet ( DMA_MODULE_ID index,
11942  DMA_CHANNEL dmaChannel )
11943  Summary:
11944  Returns the pattern matching (for DMA abort) data programmed for the specified
11945  channel.
11946  Description:
11947  This function returns pattern matching (for DMA abort) data programmed for
11948  the specified channel.
11949  (The size of pattern matching data(8-bit, 16-bit) is device-specific. Please refer to
11950  the specific device data sheet to determine availability.)
11951  Precondition:
11952  None.
11953  Parameters:
11954  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11955  Returns:
11956  - uint16_t - The pattern matching data programmed for the current channel.
11957  The size of pattern matching data(8-bit, 16-bit) is device-specific. Please refer to
11958  the specific device data sheet to determine availability.
11959  Example:
11960  <code>
11961  DMA_CHANNEL spiDMAChannel = DMA_CHANNEL_2;
11962  uint16_t patternData;
11963  patternData = PLIB_DMA_ChannelXPatternDataGet ( DMA_ID_0, spiDMAChannel );
11964  </code>
11965  Remarks:
11966  This function implements an operation of the ChannelXPatternData feature.
11967  This feature may not be available on all devices. Please refer to the
11968  specific device data sheet to determine availability or use the
11969  PLIB_DMA_ExistsChannelXPatternData function in your application to automatically
11970  determine whether this feature is available.
11971 */
11972 
11973 uint16_t
11975  DMA_MODULE_ID index ,
11976  DMA_CHANNEL dmaChannel ) ;
11977 //******************************************************************************
11978 /* Function:
11979  void PLIB_DMA_ChannelXPatternDataSet ( DMA_MODULE_ID index,
11980  DMA_CHANNEL dmaChannel,
11981  uint16_t patternData)
11982  Summary:
11983  Writes the specified pattern matching data (for DMA abort) into the register
11984  corresponding to the specified channel.
11985  Description:
11986  This function writes the specified pattern matching data (for DMA abort) into the
11987  register corresponding to the specified channel.
11988  (The size of pattern matching data(8-bit, 16-bit) is device-specific. Please refer to
11989  the specific device data sheet to determine availability.)
11990  Precondition:
11991  None.
11992  Parameters:
11993  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11994  patternData - The pattern matching DATA programmed for the current channel
11995  (The size of pattern matching data(8-bit, 16-bit) is device-specific. Please refer to
11996  the specific device data sheet to determine availability.)
11997  Returns:
11998  None.
11999  Example:
12000  <code>
12001  DMA_CHANNEL spiDMAChannel = DMA_CHANNEL_2;
12002  uint16_t patternData = '\0';
12003  PLIB_DMA_ChannelXPatternDataSet ( DMA_ID_0, spiDMAChannel, patternData );
12004  </code>
12005  Remarks:
12006  This function implements an operation of the ChannelXPatternData feature.
12007  This feature may not be available on all devices. Please refer to the
12008  specific device data sheet to determine availability or use the
12009  PLIB_DMA_ExistsChannelXPatternData function in your application to automatically
12010  determine whether this feature is available.
12011 */
12012 
12013 void
12015  DMA_MODULE_ID index ,
12016  DMA_CHANNEL dmaChannel ,
12017  uint16_t patternData ) ;
12018 // *****************************************************************************
12019 // *****************************************************************************
12020 // Section: DMA Interrupt Control Interface functions
12021 // *****************************************************************************
12022 // *****************************************************************************
12023 //******************************************************************************
12024 /* Function:
12025  bool PLIB_DMA_ChannelXINTSourceFlagGet ( DMA_MODULE_ID index,
12026  DMA_CHANNEL dmaChannel,
12027  DMA_INT_TYPE dmaINTSource )
12028  Summary:
12029  Returns the status of the interrupt flag of the specified DMA interrupt source
12030  for the specified channel.
12031  Description:
12032  This function returns the status of the interrupt flag of the specified DMA interrupt
12033  source for the specified channel.
12034  Precondition:
12035  None.
12036  Parameters:
12037  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
12038  dmaINTSource - One of the DMA interrupt sources specified by DMA_INT_TYPE
12039  Returns:
12040  - true - The interrupt flag is set
12041  - false - The interrupt flag is not set
12042  Example:
12043  <code>
12044  DMA_CHANNEL spiDMAChannel = DMA_CHANNEL_2;
12045  bool AddressErrorINTStatus;
12046  AddressErrorINTStatus = PLIB_DMA_ChannelXINTSourceFlagGet (
12047  DMA_ID_0,
12048  spiDMAChannel,
12049  DMA_INT_ADDRESS_ERROR );
12050  </code>
12051  Remarks:
12052  This function implements an operation of the ChannelXINTSourceFlag feature.
12053  This feature may not be available on all devices. Please refer to the
12054  specific device data sheet to determine availability or use the
12055  PLIB_DMA_ExistsChannelXINTSourceFlag function in your application to automatically
12056  determine whether this feature is available.
12057 */
12058 
12059 bool
12061  DMA_MODULE_ID index ,
12062  DMA_CHANNEL dmaChannel ,
12063  DMA_INT_TYPE dmaINTSource ) ;
12064 //******************************************************************************
12065 /* Function:
12066  void PLIB_DMA_ChannelXINTSourceFlagSet ( DMA_MODULE_ID index,
12067  DMA_CHANNEL dmaChannel,
12068  DMA_INT_TYPE dmaINTSource )
12069  Summary:
12070  Sets the interrupt flag of the specified DMA interrupt source for the specified channel.
12071  Description:
12072  This function sets the interrupt flag of the specified DMA interrupt source for
12073  the specified channel.
12074  Precondition:
12075  None.
12076  Parameters:
12077  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
12078  dmaINTSource - One of the DMA interrupt sources specified by DMA_INT_TYPE
12079  Returns:
12080  None.
12081  Example:
12082  <code>
12083  DMA_CHANNEL spiDMAChannel = DMA_CHANNEL_2;
12084  PLIB_DMA_ChannelXINTSourceFlagSet ( DMA_ID_0,
12085  spiDMAChannel,
12086  DMA_INT_ADDRESS_ERROR );
12087  </code>
12088  Remarks:
12089  This function implements an operation of the ChannelXINTSourceFlag feature.
12090  This feature may not be available on all devices. Please refer to the
12091  specific device data sheet to determine availability or use the
12092  PLIB_DMA_ExistsChannelXINTSourceFlag function in your application to automatically
12093  determine whether this feature is available.
12094 */
12095 
12096 void
12098  DMA_MODULE_ID index ,
12099  DMA_CHANNEL dmaChannel ,
12100  DMA_INT_TYPE dmaINTSource ) ;
12101 //******************************************************************************
12102 /* Function:
12103  void PLIB_DMA_ChannelXINTSourceFlagClear ( DMA_MODULE_ID index,
12104  DMA_CHANNEL dmaChannel,
12105  DMA_INT_TYPE dmaINTSource )
12106  Summary:
12107  Clears the interrupt flag of the specified DMA interrupt source
12108  for the specified channel.
12109  Description:
12110  This function clears the interrupt flag of the specified DMA interrupt source
12111  for the specified channel.
12112  Precondition:
12113  None.
12114  Parameters:
12115  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
12116  dmaINTSource - One of the DMA interrupt sources specified by DMA_INT_TYPE
12117  Returns:
12118  None.
12119  Example:
12120  <code>
12121  DMA_CHANNEL spiDMAChannel = DMA_CHANNEL_2;
12122  PLIB_DMA_ChannelXINTSourceFlagClear ( DMA_ID_0,
12123  spiDMAChannel,
12124  DMA_INT_ADDRESS_ERROR );
12125  </code>
12126  Remarks:
12127  This function implements an operation of the ChannelXINTSourceFlag feature.
12128  This feature may not be available on all devices. Please refer to the
12129  specific device data sheet to determine availability or use the
12130  PLIB_DMA_ExistsChannelXINTSourceFlag function in your application to automatically
12131  determine whether this feature is available.
12132 */
12133 
12134 void
12136  DMA_MODULE_ID index ,
12137  DMA_CHANNEL dmaChannel ,
12138  DMA_INT_TYPE dmaINTSource ) ;
12139 //******************************************************************************
12140 /* Function:
12141  void PLIB_DMA_ChannelXINTSourceEnable ( DMA_MODULE_ID index,
12142  DMA_CHANNEL dmaChannel,
12143  DMA_INT_TYPE dmaINTSource )
12144  Summary:
12145  Enables the specified interrupt source for the specified channel.
12146  Description:
12147  This function enables the specified interrupt source for the specified channel.
12148  Precondition:
12149  None.
12150  Parameters:
12151  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
12152  dmaINTSource - One of the DMA interrupt sources specified by DMA_INT_TYPE
12153  Returns:
12154  None.
12155  Example:
12156  <code>
12157  DMA_CHANNEL spiDMAChannel = DMA_CHANNEL_2;
12158  PLIB_DMA_ChannelXINTSourceEnable ( DMA_ID_0,
12159  spiDMAChannel,
12160  DMA_INT_ADDRESS_ERROR );
12161  </code>
12162  Remarks:
12163  This function implements an operation of the ChannelXINTSource feature.
12164  This feature may not be available on all devices. Please refer to the
12165  specific device data sheet to determine availability or use the
12166  PLIB_DMA_ExistsChannelXINTSource function in your application to automatically
12167  determine whether this feature is available.
12168 */
12169 
12170 void
12172  DMA_MODULE_ID index ,
12173  DMA_CHANNEL dmaChannel ,
12174  DMA_INT_TYPE dmaINTSource ) ;
12175 //******************************************************************************
12176 /* Function:
12177  void PLIB_DMA_ChannelXINTSourceDisable ( DMA_MODULE_ID index,
12178  DMA_CHANNEL dmaChannel,
12179  DMA_INT_TYPE dmaINTSource )
12180  Summary:
12181  Disables the specified interrupt source for the specified channel.
12182  Description:
12183  This function disables the specified interrupt source for the specified channel.
12184  Precondition:
12185  None.
12186  Parameters:
12187  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
12188  dmaINTSource - One of the DMA interrupt sources specified by DMA_INT_TYPE
12189  Returns:
12190  None.
12191  Example:
12192  <code>
12193  DMA_CHANNEL spiDMAChannel = DMA_CHANNEL_2;
12194  PLIB_DMA_ChannelXINTSourceDisable ( DMA_ID_0,
12195  spiDMAChannel,
12196  DMA_INT_ADDRESS_ERROR );
12197  </code>
12198  Remarks:
12199  This function implements an operation of the ChannelXINTSource feature.
12200  This feature may not be available on all devices. Please refer to the
12201  specific device data sheet to determine availability or use the
12202  PLIB_DMA_ExistsChannelXINTSource function in your application to automatically
12203  determine whether this feature is available.
12204 */
12205 
12206 void
12208  DMA_MODULE_ID index ,
12209  DMA_CHANNEL dmaChannel ,
12210  DMA_INT_TYPE dmaINTSource ) ;
12211 //******************************************************************************
12212 /* Function:
12213  bool PLIB_DMA_ChannelXINTSourceIsEnabled ( DMA_MODULE_ID index,
12214  DMA_CHANNEL dmaChannel,
12215  DMA_INT_TYPE dmaINTSource )
12216  Summary:
12217  Returns the enable status of the specified interrupt source for the specified channel.
12218  Description:
12219  This function returns the enable status of the specified interrupt source for the
12220  specified channel.
12221  Precondition:
12222  None.
12223  Parameters:
12224  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
12225  dmaINTSource - One of the DMA interrupt sources specified by DMA_INT_TYPE
12226  Returns:
12227  - true - The interrupt is enabled
12228  - false - The interrupt is not enabled
12229  Example:
12230  <code>
12231  DMA_CHANNEL spiDMAChannel = DMA_CHANNEL_2;
12232  bool dmaINTSourceEnableStatus;
12233  dmaINTSourceEnableStatus = PLIB_DMA_ChannelXINTSourceIsEnabled (
12234  DMA_ID_0,
12235  spiDMAChannel,
12236  DMA_INT_ADDRESS_ERROR );
12237  </code>
12238  Remarks:
12239  This function implements an operation of the ChannelXINTSource feature.
12240  This feature may not be available on all devices. Please refer to the
12241  specific device data sheet to determine availability or use the
12242  PLIB_DMA_ExistsChannelXINTSource function in your application to automatically
12243  determine whether this feature is available.
12244 */
12245 
12246 bool
12248  DMA_MODULE_ID index ,
12249  DMA_CHANNEL dmaChannel ,
12250  DMA_INT_TYPE dmaINTSource ) ;
12251 //******************************************************************************
12252 /* Function:
12253  void PLIB_DMA_ChannelXPatternLengthSet( DMA_MODULE_ID index,
12254  DMA_CHANNEL dmaChannel,DMA_PATTERN_LENGTH patternLen )
12255  Summary:
12256  Sets the pattern match length.
12257  Description:
12258  This function sets the length of the pattern match ignore to 1 or 2 bytes.
12259  Precondition:
12260  None.
12261  Parameters:
12262  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
12263  patternLen - Length of pattern match (either 1 or 2)
12264  Returns:
12265  None.
12266  Example:
12267  <code>
12268  DMA_CHANNEL dmaChannel = DMA_CHANNEL_2;
12269  DMA_PATTERN_LENGTH patternLen;
12270  patternLen = DMA_PATTERN_MATCH_LENGTH_1BYTE;
12271  PLIB_DMA_ChannelXPatternLengthSet(DMA_ID_0, dmaChannel, patternLen);
12272  </code>
12273  Remarks:
12274  This function implements an operation of the ChannelXPatternLength feature.
12275  This feature may not be available on all devices. Please refer to the
12276  specific device data sheet to determine availability or use the
12277  PLIB_DMA_ExistsChannelXPatternLength function in your application to automatically
12278  determine whether this feature is available.
12279 */
12280 
12281 void
12283  DMA_MODULE_ID index ,
12284  DMA_CHANNEL dmaChannel ,
12285  DMA_PATTERN_LENGTH patternLen ) ;
12286 //******************************************************************************
12287 /* Function:
12288  DMA_PATTERN_LENGTH PLIB_DMA_ChannelXPatternLengthGet( DMA_MODULE_ID index,
12289  DMA_CHANNEL dmaChannel);
12290  Summary:
12291  Returns the pattern match length.
12292  Description:
12293  This function returns the length of the byte matching the CHPIGN bits during a
12294  pattern match that may be ignored during the pattern match determination when
12295  the CHPIGNEN bit is set.
12296  Precondition:
12297  None.
12298  Parameters:
12299  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
12300  Returns:
12301  - patternLen - Length of pattern match (either 1 or 2)
12302  Example:
12303  <code>
12304  DMA_CHANNEL dmaChannel = DMA_CHANNEL_2;
12305  DMA_PATTERN_LENGTH patternLen;
12306  patternLen = PLIB_DMA_ChannelXPatternLengthGet(DMA_ID_0, dmaChannel);
12307  </code>
12308  Remarks:
12309  This function implements an operation of the ChannelXPatternLength feature.
12310  This feature may not be available on all devices. Please refer to the
12311  specific device data sheet to determine availability or use the
12312  PLIB_DMA_ExistsChannelXPatternLength function in your application to automatically
12313  determine whether this feature is available.
12314 */
12315 
12316 DMA_PATTERN_LENGTH
12318  DMA_MODULE_ID index ,
12319  DMA_CHANNEL dmaChannel ) ;
12320 //******************************************************************************
12321 /* Function:
12322  void PLIB_DMA_ChannelXPatternIgnoreByteEnable ( DMA_MODULE_ID index,
12323  DMA_CHANNEL channel );
12324  Summary:
12325  Enables the pattern match ignore byte.
12326  Description:
12327  This function enables the pattern match ignore byte.
12328  Precondition:
12329  None.
12330  Parameters:
12331  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
12332  Returns:
12333  None.
12334  Example:
12335  <code>
12336  DMA_CHANNEL dmaChannel = DMA_CHANNEL_2;
12337  PLIB_DMA_ChannelXPatternIgnoreByteEnable(DMA_ID_0, dmaChannel);
12338  </code>
12339  Remarks:
12340  This function implements an operation of the ChannelXPatternIgnoreByte feature.
12341  This feature may not be available on all devices. Please refer to the
12342  specific device data sheet to determine availability or use the
12343  PLIB_DMA_ExistsChannelXPatternIgnoreByte function in your application to automatically
12344  determine whether this feature is available.
12345 */
12346 
12347 void
12349  DMA_MODULE_ID index ,
12350  DMA_CHANNEL channel ) ;
12351 //******************************************************************************
12352 /* Function:
12353  bool PLIB_DMA_ChannelXPatternIgnoreByteIsEnabled ( DMA_MODULE_ID index,
12354  DMA_CHANNEL channel );
12355  Summary:
12356  Returns the state of the pattern match ignore byte.
12357  Description:
12358  This function returns the state (enabled or disabled) of the pattern match
12359  ignore byte.
12360  Precondition:
12361  None.
12362  Parameters:
12363  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
12364  Returns:
12365  - true - The pattern match ignore byte is enabled
12366  - false - The pattern match ignore byte is disabled
12367  Example:
12368  <code>
12369  bool patternIsEnabled;
12370  DMA_CHANNEL dmaChannel = DMA_CHANNEL_2;
12371  patternIsEnabled = PLIB_DMA_ChannelXPatternIgnoreByteIsEnabled(DMA_ID_0, dmaChannel);
12372  </code>
12373  Remarks:
12374  This function implements an operation of the ChannelXPatternIgnoreByte feature.
12375  This feature may not be available on all devices. Please refer to the
12376  specific device data sheet to determine availability or use the
12377  PLIB_DMA_ExistsChannelXPatternIgnoreByte function in your application to automatically
12378  determine whether this feature is available.
12379 */
12380 
12381 bool
12383  DMA_MODULE_ID index ,
12384  DMA_CHANNEL channel ) ;
12385 //******************************************************************************
12386 /* Function:
12387  void PLIB_DMA_ChannelXPatternIgnoreByteDisable ( DMA_MODULE_ID index,
12388  DMA_CHANNEL channel );
12389  Summary:
12390  Disables the pattern match ignore byte.
12391  Description:
12392  This function disables the pattern match ignore byte.
12393  Precondition:
12394  None.
12395  Parameters:
12396  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
12397  Returns:
12398  None.
12399  Example:
12400  <code>
12401  DMA_CHANNEL dmaChannel = DMA_CHANNEL_2;
12402  PLIB_DMA_ChannelXPatternIgnoreByteDisable(DMA_ID_0, dmaChannel);
12403  </code>
12404  Remarks:
12405  This function implements an operation of the ChannelXPatternIgnoreByte feature.
12406  This feature may not be available on all devices. Please refer to the
12407  specific device data sheet to determine availability or use the
12408  PLIB_DMA_ExistsChannelXPatternIgnoreByte function in your application to automatically
12409  determine whether this feature is available.
12410 */
12411 
12412 void
12414  DMA_MODULE_ID index ,
12415  DMA_CHANNEL channel ) ;
12416 //******************************************************************************
12417 /* Function:
12418  void PLIB_DMA_ChannelXPatternIgnoreSet (DMA_MODULE_ID index,
12419  DMA_CHANNEL channel, uint8_t pattern );
12420  Summary:
12421  Sets the pattern match ignore value.
12422  Description:
12423  This function sets the value of the pattern match ignore.
12424  Precondition:
12425  None.
12426  Parameters:
12427  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
12428  pattern - Pattern match ignore value
12429  Returns:
12430  None.
12431  Example:
12432  <code>
12433  uint8_t patternMatch = 0x8;
12434  DMA_CHANNEL dmaChannel = DMA_CHANNEL_2;
12435  PLIB_DMA_ChannelXPatternIgnoreSet ( DMA_ID_0, dmaChannel,patternMatch);
12436  </code>
12437  Remarks:
12438  This function implements an operation of the ChannelXPatternIgnore feature.
12439  This feature may not be available on all devices. Please refer to the
12440  specific device data sheet to determine availability or use the
12441  PLIB_DMA_ExistsChannelXPatternIgnore function in your application to automatically
12442  determine whether this feature is available.
12443 */
12444 
12445 void
12447  DMA_MODULE_ID index ,
12448  DMA_CHANNEL channel ,
12449  uint8_t pattern ) ;
12450 //******************************************************************************
12451 /* Function:
12452  uint8_t PLIB_DMA_ChannelXPatternIgnoreGet( DMA_MODULE_ID index,
12453  DMA_CHANNEL channel );
12454  Summary:
12455  Returns the pattern match ignore value.
12456  Description:
12457  This function returns the value of the pattern match ignore.
12458  Precondition:
12459  None.
12460  Parameters:
12461  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
12462  Returns:
12463  - uint8_t - Pattern match ignore value
12464  Example:
12465  <code>
12466  uint8_t patternMatch;
12467  DMA_CHANNEL dmaChannel = DMA_CHANNEL_2;
12468  patternMatch = PLIB_DMA_ChannelXPatternIgnoreGet ( DMA_ID_0, dmaChannel);
12469  </code>
12470  Remarks:
12471  This function implements an operation of the ChannelXPatternIgnore feature.
12472  This feature may not be available on all devices. Please refer to the
12473  specific device data sheet to determine availability or use the
12474  PLIB_DMA_ExistsChannelXPatternIgnore function in your application to automatically
12475  determine whether this feature is available.
12476 */
12477 
12478 uint8_t
12480  DMA_MODULE_ID index ,
12481  DMA_CHANNEL channel ) ;
12482 // *****************************************************************************
12483 // *****************************************************************************
12484 // Section: DMA Peripheral Library Exists API Routines
12485 // *****************************************************************************
12486 // *****************************************************************************
12487 /* The following functions indicate the existence of the features on the device.
12488 */
12489 //******************************************************************************
12490 /* Function : PLIB_DMA_ExistsBusy( DMA_MODULE_ID index )
12491  Summary:
12492  Identifies whether the Busy feature exists on the DMA module.
12493  Description:
12494  This function identifies whether the Busy feature is available on the
12495  DMA module.
12496  When this function returns true, these functions are supported on the device:
12497  - PLIB_DMA_BusyActiveSet
12498  - PLIB_DMA_BusyActiveReset
12499  - PLIB_DMA_IsBusy
12500  Preconditions:
12501  None.
12502  Parameters:
12503  index - Identifier for the device instance
12504  Returns:
12505  - true - The Busy feature is supported on the device
12506  - false - The Busy feature is not supported on the device
12507  Remarks:
12508  None.
12509 */
12510 
12511 bool
12513  DMA_MODULE_ID index ) ;
12514 //******************************************************************************
12515 /* Function : PLIB_DMA_ExistsSuspend( DMA_MODULE_ID index )
12516  Summary:
12517  Identifies whether the Suspend feature exists on the DMA module.
12518  Description:
12519  This function identifies whether the Suspend feature is available on the
12520  DMA module.
12521  When this function returns true, these functions are supported on the device:
12522  - PLIB_DMA_SuspendEnable
12523  - PLIB_DMA_SuspendDisable
12524  - PLIB_DMA_SuspendIsEnabled
12525  Preconditions:
12526  None.
12527  Parameters:
12528  index - Identifier for the device instance
12529  Returns:
12530  - true - The Suspend feature is supported on the device
12531  - false - The Suspend feature is not supported on the device
12532  Remarks:
12533  None.
12534 */
12535 
12536 bool
12538  DMA_MODULE_ID index ) ;
12539 //******************************************************************************
12540 /* Function : PLIB_DMA_ExistsStopInIdle( DMA_MODULE_ID index )
12541  Summary:
12542  Identifies whether the StopInIdle feature exists on the DMA module.
12543  Description:
12544  This function identifies whether the StopInIdle feature is available on the
12545  DMA module.
12546  When this function returns true, these functions are supported on the device:
12547  - PLIB_DMA_StopInIdleEnable
12548  - PLIB_DMA_StopInIdleDisable
12549  Preconditions:
12550  None.
12551  Parameters:
12552  index - Identifier for the device instance
12553  Returns:
12554  - true - The StopInIdle feature is supported on the device
12555  - false - The StopInIdle feature is not supported on the device
12556  Remarks:
12557  None.
12558 */
12559 
12560 bool
12562  DMA_MODULE_ID index ) ;
12563 //******************************************************************************
12564 /* Function : PLIB_DMA_ExistsEnableControl( DMA_MODULE_ID index )
12565  Summary:
12566  Identifies whether the EnableControl feature exists on the DMA module.
12567  Description:
12568  This function identifies whether the EnableControl feature is available on
12569  the DMA module.
12570  When this function returns true, these functions are supported on the device:
12571  - PLIB_DMA_Enable
12572  - PLIB_DMA_Disable
12573  - PLIB_DMA_IsEnabled
12574  Preconditions:
12575  None.
12576  Parameters:
12577  index - Identifier for the device instance
12578  Returns:
12579  - true - The EnableControl feature is supported on the device
12580  - false - The EnableControl feature is not supported on the device
12581  Remarks:
12582  None.
12583 */
12584 
12585 bool
12587  DMA_MODULE_ID index ) ;
12588 //******************************************************************************
12589 /* Function : PLIB_DMA_ExistsChannelBits( DMA_MODULE_ID index )
12590  Summary:
12591  Identifies whether the ChannelBits feature exists on the DMA module.
12592  Description:
12593  This function identifies whether the ChannelBits feature is available on the
12594  DMA module.
12595  When this function returns true, this function is supported on the device:
12596  - PLIB_DMA_ChannelBitsGet
12597  Preconditions:
12598  None.
12599  Parameters:
12600  index - Identifier for the device instance
12601  Returns:
12602  - true - The ChannelBits feature is supported on the device
12603  - false - The ChannelBits feature is not supported on the device
12604  Remarks:
12605  None.
12606 */
12607 
12608 bool
12610  DMA_MODULE_ID index ) ;
12611 //******************************************************************************
12612 /* Function : PLIB_DMA_ExistsLastBusAccess( DMA_MODULE_ID index )
12613  Summary:
12614  Identifies whether the LastBusAccess feature exists on the DMA module.
12615  Description:
12616  This function identifies whether the LastBusAccess feature is available on the
12617  DMA module.
12618  When this function returns true, these functions are supported on the device:
12619  - PLIB_DMA_LastBusAccessIsRead
12620  - PLIB_DMA_LastBusAccessIsWrite
12621  Preconditions:
12622  None.
12623  Parameters:
12624  index - Identifier for the device instance
12625  Returns:
12626  - true - The LastBusAccess feature is supported on the device
12627  - false - The LastBusAccess feature is not supported on the device
12628  Remarks:
12629  None.
12630 */
12631 
12632 bool
12634  DMA_MODULE_ID index ) ;
12635 //******************************************************************************
12636 /* Function : PLIB_DMA_ExistsRecentAddress( DMA_MODULE_ID index )
12637  Summary:
12638  Identifies whether the RecentAddress feature exists on the DMA module.
12639  Description:
12640  This function identifies whether the RecentAddress feature is available on
12641  the DMA module.
12642  When this function returns true, this function is supported on the device:
12643  - PLIB_DMA_RecentAddressAccessed
12644  Preconditions:
12645  None.
12646  Parameters:
12647  index - Identifier for the device instance
12648  Returns:
12649  - true - The RecentAddress feature is supported on the device
12650  - false - The RecentAddress feature is not supported on the device
12651  Remarks:
12652  None.
12653 */
12654 
12655 bool
12657  DMA_MODULE_ID index ) ;
12658 //******************************************************************************
12659 /* Function : PLIB_DMA_ExistsCRCChannel( DMA_MODULE_ID index )
12660  Summary:
12661  Identifies whether the CRCChannel feature exists on the DMA module.
12662  Description:
12663  This function identifies whether the CRCChannel feature is available on the
12664  DMA module.
12665  When this function returns true, these functions are supported on the device:
12666  - PLIB_DMA_CRCChannelSelect
12667  - PLIB_DMA_CRCChannelGet
12668  Preconditions:
12669  None.
12670  Parameters:
12671  index - Identifier for the device instance
12672  Returns:
12673  - true - The CRCChannel feature is supported on the device
12674  - false - The CRCChannel feature is not supported on the device
12675  Remarks:
12676  None.
12677 */
12678 
12679 bool
12681  DMA_MODULE_ID index ) ;
12682 //******************************************************************************
12683 /* Function : PLIB_DMA_ExistsCRCType( DMA_MODULE_ID index )
12684  Summary:
12685  Identifies whether the CRCType feature exists on the DMA module.
12686  Description:
12687  This function identifies whether the CRCType feature is available on the
12688  DMA module.
12689  When this function returns true, these functions are supported on the device:
12690  - PLIB_DMA_CRCTypeGet
12691  - PLIB_DMA_CRCTypeSet
12692  Preconditions:
12693  None.
12694  Parameters:
12695  index - Identifier for the device instance
12696  Returns:
12697  - true - The CRCType feature is supported on the device
12698  - false - The CRCType feature is not supported on the device
12699  Remarks:
12700  None.
12701 */
12702 
12703 bool
12705  DMA_MODULE_ID index ) ;
12706 //******************************************************************************
12707 /* Function : PLIB_DMA_ExistsCRCAppendMode( DMA_MODULE_ID index )
12708  Summary:
12709  Identifies whether the CRCAppendMode feature exists on the DMA module.
12710  Description:
12711  This function identifies whether the CRCAppendMode feature is available on
12712  the DMA module.
12713  When this function returns true, these functions are supported on the device:
12714  - PLIB_DMA_CRCAppendModeEnable
12715  - PLIB_DMA_CRCAppendModeDisable
12716  - PLIB_DMA_CRCAppendModeIsEnabled
12717  Preconditions:
12718  None.
12719  Parameters:
12720  index - Identifier for the device instance
12721  Returns:
12722  - true - The CRCAppendMode feature is supported on the device
12723  - false - The CRCAppendMode feature is not supported on the device
12724  Remarks:
12725  None.
12726 */
12727 
12728 bool
12730  DMA_MODULE_ID index ) ;
12731 //******************************************************************************
12732 /* Function : PLIB_DMA_ExistsCRC( DMA_MODULE_ID index )
12733  Summary:
12734  Identifies whether the CRC feature exists on the DMA module.
12735  Description:
12736  This function identifies whether the CRC feature is available on the DMA module.
12737  When this function returns true, these functions are supported on the device:
12738  - PLIB_DMA_CRCEnable
12739  - PLIB_DMA_CRCDisable
12740  - PLIB_DMA_CRCIsEnabled
12741  Preconditions:
12742  None.
12743  Parameters:
12744  index - Identifier for the device instance
12745  Returns:
12746  - true - The CRC feature is supported on the device
12747  - false - The CRC feature is not supported on the device
12748  Remarks:
12749  None.
12750 */
12751 
12752 bool
12754  DMA_MODULE_ID index ) ;
12755 //******************************************************************************
12756 /* Function : PLIB_DMA_ExistsCRCPolynomialLength( DMA_MODULE_ID index )
12757  Summary:
12758  Identifies whether the CRCPolynomialLength feature exists on the DMA module.
12759  Description:
12760  This function identifies whether the CRCPolynomialLength feature is available
12761  on the DMA module.
12762  When this function returns true, these functions are supported on the device:
12763  - PLIB_DMA_CRCPolynomialLengthSet
12764  - PLIB_DMA_CRCPolynomialLengthGet
12765  Preconditions:
12766  None.
12767  Parameters:
12768  index - Identifier for the device instance
12769  Returns:
12770  - true - The CRCPolynomialLength feature is supported on the device
12771  - false - The CRCPolynomialLength feature is not supported on the device
12772  Remarks:
12773  None.
12774 */
12775 
12776 bool
12778  DMA_MODULE_ID index ) ;
12779 //******************************************************************************
12780 /* Function : PLIB_DMA_ExistsCRCBitOrder( DMA_MODULE_ID index )
12781  Summary:
12782  Identifies whether the CRCBitOrder feature exists on the DMA module.
12783  Description:
12784  This function identifies whether the CRCBitOrder feature is available on the
12785  DMA module.
12786  When this function returns true, this function is supported on the device:
12787  - PLIB_DMA_CRCBitOrderSelect
12788  Preconditions:
12789  None.
12790  Parameters:
12791  index - Identifier for the device instance
12792  Returns:
12793  - true - The CRCBitOrder feature is supported on the device
12794  - false - The CRCBitOrder feature is not supported on the device
12795  Remarks:
12796  None.
12797 */
12798 
12799 bool
12801  DMA_MODULE_ID index ) ;
12802 //******************************************************************************
12803 /* Function : PLIB_DMA_ExistsCRCWriteByteOrder( DMA_MODULE_ID index )
12804  Summary:
12805  Identifies whether the CRCWriteByteOrder feature exists on the DMA module.
12806  Description:
12807  This function identifies whether the CRCWriteByteOrder feature is available
12808  on the DMA module.
12809  When this function returns true, these functions are supported on the device:
12810  - PLIB_DMA_CRCWriteByteOrderAlter
12811  - PLIB_DMA_CRCWriteByteOrderMaintain
12812  Preconditions:
12813  None.
12814  Parameters:
12815  index - Identifier for the device instance
12816  Returns:
12817  - true - The CRCWriteByteOrder feature is supported on the device
12818  - false - The CRCWriteByteOrder feature is not supported on the device
12819  Remarks:
12820  None.
12821 */
12822 
12823 bool
12825  DMA_MODULE_ID index ) ;
12826 //******************************************************************************
12827 /* Function : PLIB_DMA_ExistsCRCByteOrder( DMA_MODULE_ID index )
12828  Summary:
12829  Identifies whether the CRCByteOrder feature exists on the DMA module.
12830  Description:
12831  This function identifies whether the CRCByteOrder feature is available on
12832  the DMA module.
12833  When this function returns true, these functions are supported on the device:
12834  - PLIB_DMA_CRCByteOrderSelect
12835  - PLIB_DMA_CRCByteOrderGet
12836  Preconditions:
12837  None.
12838  Parameters:
12839  index - Identifier for the device instance
12840  Returns:
12841  - true - The CRCByteOrder feature is supported on the device
12842  - false - The CRCByteOrder feature is not supported on the device
12843  Remarks:
12844  None.
12845 */
12846 
12847 bool
12849  DMA_MODULE_ID index ) ;
12850 //******************************************************************************
12851 /* Function : PLIB_DMA_ExistsCRCData( DMA_MODULE_ID index )
12852  Summary:
12853  Identifies whether the CRCData feature exists on the DMA module.
12854  Description:
12855  This function identifies whether the CRCData feature is available on the
12856  DMA module.
12857  When this function returns true, these functions are supported on the device:
12858  - PLIB_DMA_CRCDataRead
12859  - PLIB_DMA_CRCDataWrite
12860  Preconditions:
12861  None.
12862  Parameters:
12863  index - Identifier for the device instance
12864  Returns:
12865  - true - The CRCData feature is supported on the device
12866  - false - The CRCData feature is not supported on the device
12867  Remarks:
12868  None.
12869 */
12870 
12871 bool
12873  DMA_MODULE_ID index ) ;
12874 //******************************************************************************
12875 /* Function : PLIB_DMA_ExistsCRCXOREnable( DMA_MODULE_ID index )
12876  Summary:
12877  Identifies whether the CRCXOREnable feature exists on the DMA module.
12878  Description:
12879  This function identifies whether the CRCXOREnable feature is available on the
12880  DMA module.
12881  When this function returns true, these functions are supported on the device:
12882  - PLIB_DMA_CRCXOREnableSet
12883  - PLIB_DMA_CRCXOREnableGet
12884  Preconditions:
12885  None.
12886  Parameters:
12887  index - Identifier for the device instance
12888  Returns:
12889  - true - The CRCXOREnable feature is supported on the device
12890  - false - The CRCXOREnable feature is not supported on the device
12891  Remarks:
12892  None.
12893 */
12894 
12895 bool
12897  DMA_MODULE_ID index ) ;
12898 //******************************************************************************
12899 /* Function : PLIB_DMA_ExistsChannelXPriority( DMA_MODULE_ID index )
12900  Summary:
12901  Identifies whether the ChannelXPriority feature exists on the DMA module.
12902  Description:
12903  This function identifies whether the ChannelXPriority feature is available on
12904  the DMA module.
12905  When this function returns true, these functions are supported on the device:
12906  - PLIB_DMA_ChannelXPrioritySelect
12907  - PLIB_DMA_ChannelXPriorityGet
12908  Preconditions:
12909  None.
12910  Parameters:
12911  index - Identifier for the device instance
12912  Returns:
12913  - true - The ChannelXPriority feature is supported on the device
12914  - false - The ChannelXPriority feature is not supported on the device
12915  Remarks:
12916  None.
12917 */
12918 
12919 bool
12921  DMA_MODULE_ID index ) ;
12922 //******************************************************************************
12923 /* Function : PLIB_DMA_ExistsChannelXEvent( DMA_MODULE_ID index )
12924  Summary:
12925  Identifies whether the ChannelXEvent feature exists on the DMA module.
12926  Description:
12927  This function identifies whether the ChannelXEvent feature is available on
12928  the DMA module.
12929  When this function returns true, this function is supported on the device:
12930  - PLIB_DMA_ChannelXEventIsDetected
12931  Preconditions:
12932  None.
12933  Parameters:
12934  index - Identifier for the device instance
12935  Returns:
12936  - true - The ChannelXEvent feature is supported on the device
12937  - false - The ChannelXEvent feature is not supported on the device
12938  Remarks:
12939  None.
12940 */
12941 
12942 bool
12944  DMA_MODULE_ID index ) ;
12945 //******************************************************************************
12946 /* Function : PLIB_DMA_ExistsChannelXAuto( DMA_MODULE_ID index )
12947  Summary:
12948  Identifies whether the ChannelXAuto feature exists on the DMA module.
12949  Description:
12950  This function identifies whether the ChannelXAuto feature is available on
12951  the DMA module.
12952  When this function returns true, these functions are supported on the device:
12953  - PLIB_DMA_ChannelXAutoEnable
12954  - PLIB_DMA_ChannelXAutoDisable
12955  - PLIB_DMA_ChannelXAutoIsEnabled
12956  Preconditions:
12957  None.
12958  Parameters:
12959  index - Identifier for the device instance
12960  Returns:
12961  - true - The ChannelXAuto feature is supported on the device
12962  - false - The ChannelXAuto feature is not supported on the device
12963  Remarks:
12964  None.
12965 */
12966 
12967 bool
12969  DMA_MODULE_ID index ) ;
12970 //******************************************************************************
12971 /* Function : PLIB_DMA_ExistsChannelXChainEnbl( DMA_MODULE_ID index )
12972  Summary:
12973  Identifies whether the ChannelXChainEnbl feature exists on the DMA module.
12974  Description:
12975  This function identifies whether the ChannelXChainEnbl feature is available
12976  on the DMA module.
12977  When this function returns true, these functions are supported on the device:
12978  - PLIB_DMA_ChannelXChainEnable
12979  - PLIB_DMA_ChannelXChainDisable
12980  - PLIB_DMA_ChannelXChainIsEnabled
12981  Preconditions:
12982  None.
12983  Parameters:
12984  index - Identifier for the device instance
12985  Returns:
12986  - true - The ChannelXChainEnbl feature is supported on the device
12987  - false - The ChannelXChainEnbl feature is not supported on the device
12988  Remarks:
12989  None.
12990 */
12991 
12992 bool
12994  DMA_MODULE_ID index ) ;
12995 //******************************************************************************
12996 /* Function : PLIB_DMA_ExistsChannelXDisabled( DMA_MODULE_ID index )
12997  Summary:
12998  Identifies whether the ChannelXDisabled feature exists on the DMA module.
12999  Description:
13000  This function identifies whether the ChannelXDisabled feature is available
13001  on the DMA module.
13002  When this function returns true, these functions are supported on the device:
13003  - PLIB_DMA_ChannelXDisabledEnablesEvents
13004  - PLIB_DMA_ChannelXDisabledDisablesEvents
13005  Preconditions:
13006  None.
13007  Parameters:
13008  index - Identifier for the device instance
13009  Returns:
13010  - true - The ChannelXDisabled feature is supported on the device
13011  - false - The ChannelXDisabled feature is not supported on the device
13012  Remarks:
13013  None.
13014 */
13015 
13016 bool
13018  DMA_MODULE_ID index ) ;
13019 //******************************************************************************
13020 /* Function : PLIB_DMA_ExistsChannelX( DMA_MODULE_ID index )
13021  Summary:
13022  Identifies whether the ChannelX feature exists on the DMA module.
13023  Description:
13024  This function identifies whether the ChannelX feature is available on the
13025  DMA module.
13026  When this function returns true, these functions are supported on the device:
13027  - PLIB_DMA_ChannelXEnable
13028  - PLIB_DMA_ChannelXIsEnabled
13029  - PLIB_DMA_ChannelXDisable
13030  Preconditions:
13031  None.
13032  Parameters:
13033  index - Identifier for the device instance
13034  Returns:
13035  - true - The ChannelX feature is supported on the device
13036  - false - The ChannelX feature is not supported on the device
13037  Remarks:
13038  None.
13039 */
13040 
13041 bool
13043  DMA_MODULE_ID index ) ;
13044 //******************************************************************************
13045 /* Function : PLIB_DMA_ExistsChannelXChain( DMA_MODULE_ID index )
13046  Summary:
13047  Identifies whether the ChannelXChain feature exists on the DMA module.
13048  Description:
13049  This function identifies whether the ChannelXChain feature is available on the
13050  DMA module.
13051  When this function returns true, these functions are supported on the device:
13052  - PLIB_DMA_ChannelXChainToLower
13053  - PLIB_DMA_ChannelXChainToHigher
13054  Preconditions:
13055  None.
13056  Parameters:
13057  index - Identifier for the device instance
13058  Returns:
13059  - true - The ChannelXChain feature is supported on the device
13060  - false - The ChannelXChain feature is not supported on the device
13061  Remarks:
13062  None.
13063 */
13064 
13065 bool
13067  DMA_MODULE_ID index ) ;
13068 //******************************************************************************
13069 /* Function : PLIB_DMA_ExistsChannelXPatternLength( DMA_MODULE_ID index )
13070  Summary:
13071  Identifies whether the ChannelXPatternLength feature exists on the DMA module.
13072  Description:
13073  This function identifies whether the ChannelXPatternLength feature is available
13074  on the DMA module.
13075  When this function returns true, these functions are supported on the device:
13076  - PLIB_DMA_ChannelXPatternLengthSet
13077  - PLIB_DMA_ChannelXPatternLengthGet
13078  Preconditions:
13079  None.
13080  Parameters:
13081  index - Identifier for the device instance
13082  Returns:
13083  - true - The ChannelXPatternLength feature is supported on the device
13084  - false - The ChannelXPatternLength feature is not supported on the device
13085  Remarks:
13086  None.
13087 */
13088 
13089 bool
13091  DMA_MODULE_ID index ) ;
13092 //******************************************************************************
13093 /* Function : PLIB_DMA_ExistsChannelXPatternIgnoreByte( DMA_MODULE_ID index )
13094  Summary:
13095  Identifies whether the ChannelXPatternIgnoreByte feature exists on the DMA
13096  module.
13097  Description:
13098  This function identifies whether the ChannelXPatternIgnoreByte feature is
13099  available on the DMA module.
13100  When this function returns true, these functions are supported on the device:
13101  - PLIB_DMA_ChannelXPatternIgnoreByteEnable
13102  - PLIB_DMA_ChannelXPatternIgnoreByteIsEnabled
13103  - PLIB_DMA_ChannelXPatternIgnoreByteDisable
13104  Preconditions:
13105  None.
13106  Parameters:
13107  index - Identifier for the device instance
13108  Returns:
13109  - true - The ChannelXPatternIgnoreByte feature is supported on the device
13110  - false - The ChannelXPatternIgnoreByte feature is not supported on the device
13111  Remarks:
13112  None.
13113 */
13114 
13115 bool
13117  DMA_MODULE_ID index ) ;
13118 //******************************************************************************
13119 /* Function : PLIB_DMA_ExistsChannelXBusy( DMA_MODULE_ID index )
13120  Summary:
13121  Identifies whether the ChannelXBusy feature exists on the DMA module.
13122  Description:
13123  This function identifies whether the ChannelXBusy feature is available on the
13124  DMA module.
13125  When this function returns true, these functions are supported on the device:
13126  - PLIB_DMA_ChannelXBusyActiveSet
13127  - PLIB_DMA_ChannelXBusyInActiveSet
13128  - PLIB_DMA_ChannelXBusyIsBusy
13129  Preconditions:
13130  None.
13131  Parameters:
13132  index - Identifier for the device instance
13133  Returns:
13134  - true - The ChannelXBusy feature is supported on the device
13135  - false - The ChannelXBusy feature is not supported on the device
13136  Remarks:
13137  None.
13138 */
13139 
13140 bool
13142  DMA_MODULE_ID index ) ;
13143 //******************************************************************************
13144 /* Function : PLIB_DMA_ExistsChannelXPatternIgnore( DMA_MODULE_ID index )
13145  Summary:
13146  Identifies whether the ChannelXPatternIgnore feature exists on the DMA module.
13147  Description:
13148  This function identifies whether the ChannelXPatternIgnore feature is available
13149  on the DMA module.
13150  When this function returns true, these functions are supported on the device:
13151  - PLIB_DMA_ChannelXPatternIgnoreSet
13152  - PLIB_DMA_ChannelXPatternIgnoreGet
13153  Preconditions:
13154  None.
13155  Parameters:
13156  index - Identifier for the device instance
13157  Returns:
13158  - true - The ChannelXPatternIgnore feature is supported on the device
13159  - false - The ChannelXPatternIgnore feature is not supported on the device
13160  Remarks:
13161  None.
13162 */
13163 
13164 bool
13166  DMA_MODULE_ID index ) ;
13167 //******************************************************************************
13168 /* Function : PLIB_DMA_ExistsChannelXTrigger( DMA_MODULE_ID index )
13169  Summary:
13170  Identifies whether the ChannelXTrigger feature exists on the DMA module.
13171  Description:
13172  This function identifies whether the ChannelXTrigger feature is available on
13173  the DMA module.
13174  When this function returns true, these functions are supported on the device:
13175  - PLIB_DMA_ChannelXTriggerEnable
13176  - PLIB_DMA_ChannelXTriggerIsEnabled
13177  - PLIB_DMA_ChannelXTriggerDisable
13178  Preconditions:
13179  None.
13180  Parameters:
13181  index - Identifier for the device instance
13182  Returns:
13183  - true - The ChannelXTrigger feature is supported on the device
13184  - false - The ChannelXTrigger feature is not supported on the device
13185  Remarks:
13186  None.
13187 */
13188 
13189 bool
13191  DMA_MODULE_ID index ) ;
13192 //******************************************************************************
13193 /* Function : PLIB_DMA_ExistsAbortTransfer( DMA_MODULE_ID index )
13194  Summary:
13195  Identifies whether the AbortTransfer feature exists on the DMA module.
13196  Description:
13197  This function identifies whether the AbortTransfer feature is available on
13198  the DMA module.
13199  When this function returns true, this function is supported on the device:
13200  - PLIB_DMA_AbortTransferSet
13201  Preconditions:
13202  None.
13203  Parameters:
13204  index - Identifier for the device instance
13205  Returns:
13206  - true - The AbortTransfer feature is supported on the device
13207  - false - The AbortTransfer feature is not supported on the device
13208  Remarks:
13209  None.
13210 */
13211 
13212 bool
13214  DMA_MODULE_ID index ) ;
13215 //******************************************************************************
13216 /* Function : PLIB_DMA_ExistsStartTransfer( DMA_MODULE_ID index )
13217  Summary:
13218  Identifies whether the StartTransfer feature exists on the DMA module.
13219  Description:
13220  This function identifies whether the StartTransfer feature is available on
13221  the DMA module.
13222  When this function returns true, this function is supported on the device:
13223  - PLIB_DMA_StartTransferSet
13224  Preconditions:
13225  None.
13226  Parameters:
13227  index - Identifier for the device instance
13228  Returns:
13229  - true - The StartTransfer feature is supported on the device
13230  - false - The StartTransfer feature is not supported on the device
13231  Remarks:
13232  None.
13233 */
13234 
13235 bool
13237  DMA_MODULE_ID index ) ;
13238 //******************************************************************************
13239 /* Function : PLIB_DMA_ExistsChannelXStartIRQ( DMA_MODULE_ID index )
13240  Summary:
13241  Identifies whether the ChannelXStartIRQ feature exists on the DMA module.
13242  Description:
13243  This function identifies whether the ChannelXStartIRQ feature is available
13244  on the DMA module.
13245  When this function returns true, this function is supported on the device:
13246  - PLIB_DMA_ChannelXStartIRQSet
13247  Preconditions:
13248  None.
13249  Parameters:
13250  index - Identifier for the device instance
13251  Returns:
13252  - true - The ChannelXStartIRQ feature is supported on the device
13253  - false - The ChannelXStartIRQ feature is not supported on the device
13254  Remarks:
13255  None.
13256 */
13257 
13258 bool
13260  DMA_MODULE_ID index ) ;
13261 //******************************************************************************
13262 /* Function : PLIB_DMA_ExistsChannelXAbortIRQ( DMA_MODULE_ID index )
13263  Summary:
13264  Identifies whether the ChannelXAbortIRQ feature exists on the DMA module.
13265  Description:
13266  This function identifies whether the ChannelXAbortIRQ feature is available
13267  on the DMA module.
13268  When this function returns true, this function is supported on the device:
13269  - PLIB_DMA_ChannelXAbortIRQSet
13270  Preconditions:
13271  None.
13272  Parameters:
13273  index - Identifier for the device instance
13274  Returns:
13275  - true - The ChannelXAbortIRQ feature is supported on the device
13276  - false - The ChannelXAbortIRQ feature is not supported on the device
13277  Remarks:
13278  None.
13279 */
13280 
13281 bool
13283  DMA_MODULE_ID index ) ;
13284 //******************************************************************************
13285 /* Function : PLIB_DMA_ExistsChannelXINTSourceFlag( DMA_MODULE_ID index )
13286  Summary:
13287  Identifies whether the ChannelXINTSourceFlag feature exists on the DMA module.
13288  Description:
13289  This function identifies whether the ChannelXINTSourceFlag feature is available
13290  on the DMA module.
13291  When this function returns true, these functions are supported on the device:
13292  - PLIB_DMA_ChannelXINTSourceFlagGet
13293  - PLIB_DMA_ChannelXINTSourceFlagSet
13294  - PLIB_DMA_ChannelXINTSourceFlagClear
13295  Preconditions:
13296  None.
13297  Parameters:
13298  index - Identifier for the device instance
13299  Returns:
13300  - true - The ChannelXINTSourceFlag feature is supported on the device
13301  - false - The ChannelXINTSourceFlag feature is not supported on the device
13302  Remarks:
13303  None.
13304 */
13305 
13306 bool
13308  DMA_MODULE_ID index ) ;
13309 //******************************************************************************
13310 /* Function : PLIB_DMA_ExistsChannelXINTSource( DMA_MODULE_ID index )
13311  Summary:
13312  Identifies whether the ChannelXINTSource feature exists on the DMA module.
13313  Description:
13314  This function identifies whether the ChannelXINTSource feature is available
13315  on the DMA module.
13316  When this function returns true, these functions are supported on the device:
13317  - PLIB_DMA_ChannelXINTSourceEnable
13318  - PLIB_DMA_ChannelXINTSourceDisable
13319  - PLIB_DMA_ChannelXINTSourceIsEnabled
13320  Preconditions:
13321  None.
13322  Parameters:
13323  index - Identifier for the device instance
13324  Returns:
13325  - true - The ChannelXINTSource feature is supported on the device
13326  - false - The ChannelXINTSource feature is not supported on the device
13327  Remarks:
13328  None.
13329 */
13330 
13331 bool
13333  DMA_MODULE_ID index ) ;
13334 //******************************************************************************
13335 /* Function : PLIB_DMA_ExistsChannelXSourceStartAddress( DMA_MODULE_ID index )
13336  Summary:
13337  Identifies whether the ChannelXSourceStartAddress feature exists on the DMA module.
13338  Description:
13339  This function identifies whether the ChannelXSourceStartAddress feature is available
13340  on the DMA module.
13341  When this function returns true, these functions are supported on the device:
13342  - PLIB_DMA_ChannelXSourceStartAddressGet
13343  - PLIB_DMA_ChannelXSourceStartAddressSet
13344  Preconditions:
13345  None.
13346  Parameters:
13347  index - Identifier for the device instance
13348  Returns:
13349  - true - The ChannelXSourceStartAddress feature is supported on the device
13350  - false - The ChannelXSourceStartAddress feature is not supported on the device
13351  Remarks:
13352  None.
13353 */
13354 
13355 bool
13357  DMA_MODULE_ID index ) ;
13358 //******************************************************************************
13359 /* Function : PLIB_DMA_ExistsChannelXDestinationStartAddress( DMA_MODULE_ID index )
13360  Summary:
13361  Identifies whether the ChannelXDestinationStartAddress feature exists on
13362  the DMA module.
13363  Description:
13364  This function identifies whether the ChannelXDestinationStartAddress feature
13365  is available on the DMA module.
13366  When this function returns true, these functions are supported on the device:
13367  - PLIB_DMA_ChannelXDestinationStartAddressGet
13368  - PLIB_DMA_ChannelXDestinationStartAddressSet
13369  Preconditions:
13370  None.
13371  Parameters:
13372  index - Identifier for the device instance
13373  Returns:
13374  - true - The ChannelXDestinationStartAddress feature is supported on the device
13375  - false - The ChannelXDestinationStartAddress feature is not supported on the device
13376  Remarks:
13377  None.
13378 */
13379 
13380 bool
13382  DMA_MODULE_ID index ) ;
13383 //******************************************************************************
13384 /* Function : PLIB_DMA_ExistsChannelXSourceSize( DMA_MODULE_ID index )
13385  Summary:
13386  Identifies whether the ChannelXSourceSize feature exists on the DMA module.
13387  Description:
13388  This function identifies whether the ChannelXSourceSize feature is available
13389  on the DMA module.
13390  When this function returns true, these functions are supported on the device:
13391  - PLIB_DMA_ChannelXSourceSizeGet
13392  - PLIB_DMA_ChannelXSourceSizeSet
13393  Preconditions:
13394  None.
13395  Parameters:
13396  index - Identifier for the device instance
13397  Returns:
13398  - true - The ChannelXSourceSize feature is supported on the device
13399  - false - The ChannelXSourceSize feature is not supported on the device
13400  Remarks:
13401  None.
13402 */
13403 
13404 bool
13406  DMA_MODULE_ID index ) ;
13407 //******************************************************************************
13408 /* Function : PLIB_DMA_ExistsChannelXDestinationSize( DMA_MODULE_ID index )
13409  Summary:
13410  Identifies whether the ChannelXDestinationSize feature exists on the DMA module.
13411  Description:
13412  This function identifies whether the ChannelXDestinationSize feature is available
13413  on the DMA module.
13414  When this function returns true, these functions are supported on the device:
13415  - PLIB_DMA_ChannelXDestinationSizeGet
13416  - PLIB_DMA_ChannelXDestinationSizeSet
13417  Preconditions:
13418  None.
13419  Parameters:
13420  index - Identifier for the device instance
13421  Returns:
13422  - true - The ChannelXDestinationSize feature is supported on the device
13423  - false - The ChannelXDestinationSize feature is not supported on the device
13424  Remarks:
13425  None.
13426 */
13427 
13428 bool
13430  DMA_MODULE_ID index ) ;
13431 //******************************************************************************
13432 /* Function : PLIB_DMA_ExistsChannelXSourcePointer( DMA_MODULE_ID index )
13433  Summary:
13434  Identifies whether the ChannelXSourcePointer feature exists on the DMA module.
13435  Description:
13436  This function identifies whether the ChannelXSourcePointer feature is available
13437  on the DMA module.
13438  When this function returns true, this function is supported on the device:
13439  - PLIB_DMA_ChannelXSourcePointerGet
13440  Preconditions:
13441  None.
13442  Parameters:
13443  index - Identifier for the device instance
13444  Returns:
13445  - true - The ChannelXSourcePointer feature is supported on the device
13446  - false - The ChannelXSourcePointer feature is not supported on the device
13447  Remarks:
13448  None.
13449 */
13450 
13451 bool
13453  DMA_MODULE_ID index ) ;
13454 //******************************************************************************
13455 /* Function : PLIB_DMA_ExistsChannelXDestinationPointer( DMA_MODULE_ID index )
13456  Summary:
13457  Identifies whether the ChannelXDestinationPointer feature exists on the DMA module.
13458  Description:
13459  This function identifies whether the ChannelXDestinationPointer feature is available
13460  on the DMA module.
13461  When this function returns true, this function is supported on the device:
13462  - PLIB_DMA_ChannelXDestinationPointerGet
13463  Preconditions:
13464  None.
13465  Parameters:
13466  index - Identifier for the device instance
13467  Returns:
13468  - true - The ChannelXDestinationPointer feature is supported on the device
13469  - false - The ChannelXDestinationPointer feature is not supported on the device
13470  Remarks:
13471  None.
13472 */
13473 
13474 bool
13476  DMA_MODULE_ID index ) ;
13477 //******************************************************************************
13478 /* Function : PLIB_DMA_ExistsChannelXCellSize( DMA_MODULE_ID index )
13479  Summary:
13480  Identifies whether the ChannelXCellSize feature exists on the DMA module.
13481  Description:
13482  This function identifies whether the ChannelXCellSize feature is available on
13483  the DMA module.
13484  When this function returns true, these functions are supported on the device:
13485  - PLIB_DMA_ChannelXCellSizeGet
13486  - PLIB_DMA_ChannelXCellSizeSet
13487  Preconditions:
13488  None.
13489  Parameters:
13490  index - Identifier for the device instance
13491  Returns:
13492  - true - The ChannelXCellSize feature is supported on the device
13493  - false - The ChannelXCellSize feature is not supported on the device
13494  Remarks:
13495  None.
13496 */
13497 
13498 bool
13500  DMA_MODULE_ID index ) ;
13501 //******************************************************************************
13502 /* Function : PLIB_DMA_ExistsChannelXCellProgressPointer( DMA_MODULE_ID index )
13503  Summary:
13504  Identifies whether the ChannelXCellProgressPointer feature exists on the
13505  DMA module.
13506  Description:
13507  This function identifies whether the ChannelXCellProgressPointer feature is
13508  available on the DMA module.
13509  When this function returns true, this function is supported on the device:
13510  - PLIB_DMA_ChannelXCellProgressPointerGet
13511  Preconditions:
13512  None.
13513  Parameters:
13514  index - Identifier for the device instance
13515  Returns:
13516  - true - The ChannelXCellProgressPointer feature is supported on the device
13517  - false - The ChannelXCellProgressPointer feature is not supported on the device
13518  Remarks:
13519  None.
13520 */
13521 
13522 bool
13524  DMA_MODULE_ID index ) ;
13525 //******************************************************************************
13526 /* Function : PLIB_DMA_ExistsChannelXPatternData( DMA_MODULE_ID index )
13527  Summary:
13528  Identifies whether the ChannelXPatternData feature exists on the DMA module
13529  Description:
13530  This function identifies whether the ChannelXPatternData feature is available
13531  on the DMA module.
13532  When this function returns true, these functions are supported on the device:
13533  - PLIB_DMA_ChannelXPatternDataGet
13534  - PLIB_DMA_ChannelXPatternDataSet
13535  Preconditions:
13536  None.
13537  Parameters:
13538  index - Identifier for the device instance
13539  Returns:
13540  - true - The ChannelXPatternData feature is supported on the device
13541  - false - The ChannelXPatternData feature is not supported on the device
13542  Remarks:
13543  None.
13544 */
13545 
13546 bool
13548  DMA_MODULE_ID index ) ;
13549 //DOM-IGNORE-BEGIN
13550 //DOM-IGNORE-END
13551  // #ifndef _PLIB_DMA_H
13552 /*******************************************************************************
13553  End of File
13554 */
13555 
13556 #endif /*00 C:\microchip\harmony\v2_06\framework\peripheral\dma\plib_dma.h*/
13557 /* CLOSE_FILE Include File */
13558 
13559 // *****************************************************************************
13560 // *****************************************************************************
13561 // Section: Data Types
13562 // *****************************************************************************
13563 // *****************************************************************************
13564 // *****************************************************************************
13565 /* DMA System Service Channel None
13566  Summary:
13567  DMA channel none
13568  Description:
13569  This constant identifies the specification of no choice from client
13570  for allocating a particular DMA channel.
13571  Remarks:
13572  This constant should be used in place of hard-coded numeric literals.
13573 */
13574 //DOM-IGNORE-BEGIN
13575 #define DMA_CHANNEL_NONE ( ( DMA_CHANNEL ) - 1 )
13576 //DOM-IGNORE-END
13577 // *****************************************************************************
13578 /* DMA System Service Channel Any
13579  Summary:
13580  Identifies the client specification to allocate any available DMA channel.
13581  Description:
13582  This constant identifies the specification by the client
13583  to allocate any available DMA channel.
13584  Remarks:
13585  This constant should be used in place of hard-coded numeric literals.
13586 */
13587 //DOM-IGNORE-BEGIN
13588 #define DMA_CHANNEL_ANY ( ( DMA_CHANNEL ) - 2 )
13589 //DOM-IGNORE-END
13590 // *****************************************************************************
13591 /* DMA System Service Channel Count
13592  Summary:
13593  Identifies the maximum number of DMA channel handles to be defined.
13594  Description:
13595  This constant identifies the maximum number of DMA channel handles
13596  that should be defined.
13597  Remarks:
13598  This value is derived from device-specific header files defined as
13599  part of the peripheral libraries.
13600 */
13601 #define SYS_DMA_CHANNEL_COUNT DMA_NUMBER_OF_CHANNELS
13602 // *****************************************************************************
13603 /* DMA System Service Channel Handle
13604  Summary:
13605  Assigns the handle for requested channel.
13606  Description:
13607  A channel handle value is returned by a call to the SYS_DMA_ChannelAllocate
13608  function. This handle is associated with the channel number that is used for
13609  data transfer and it allows the application to track the data transfer.
13610  The channel handle once assigned to a client expires when the
13611  client calls SYS_DMA_ChannelRelease.
13612  exits.
13613  Remarks:
13614  None.
13615 */
13616 
13617 typedef
13618 uintptr_t
13620 // *****************************************************************************
13621 /* DMA System Service Invalid Channel Handle
13622  Summary:
13623  Defines an invalid channel handle.
13624  Description:
13625  This is the definition of an invalid channel handle. An invalid buffer handle
13626  is returned by SYS_DMA_ChannelAllocate function if the channel number
13627  request was not successful.
13628  Remarks:
13629  None.
13630 */
13631 #define SYS_DMA_CHANNEL_HANDLE_INVALID ( ( SYS_DMA_CHANNEL_HANDLE ) ( - 1 ) )
13632 // *****************************************************************************
13633 /* DMA stop in idle mode
13634  Summary:
13635  Enable/Disable DMA operations in Idle mode.
13636  Description:
13637  This data type allows enabling/disabling of DMA operations in idle mode.
13638  Remarks:
13639  The field 'sidl' (in init data structure 'SYS_DMA_INIT') is enable/disable
13640  while initializing the DMA module by calling SYS_DMA_Initialize.
13641  This feature may not be available on all devices. Refer to the specific device
13642  data sheet to determine availability.
13643 */
13644 
13645 typedef
13646  enum
13647  {
13648  /* When the CPU enters idle mode, the DMA module continue operations */
13650  /* When the CPU enters idle mode, the DMA module will discontinue operations */
13652  } SYS_DMA_SIDL ;
13653 // *****************************************************************************
13654 /* DMA Channel chaining priority
13655  Summary:
13656  Identifies the priority of chaining channel.
13657  Description:
13658  This data type identifies the priority of chaining channel.
13659  Channel chaining priority identifies the channel that will be enabled
13660  on completion of block data transfer on the master channel.
13661  Remarks:
13662  None.
13663 */
13664 
13665 typedef
13666  enum
13667  {
13668  /* Chain to channel higher in natural priority */
13670  /* Chain to channel lower in natural priority */
13673 // *****************************************************************************
13674 /* DMA Channel ignore pattern match
13675  Summary:
13676  Enables/Disables the feature to ignore a byte between a 2-byte match abort
13677  pattern.
13678  Description:
13679  This data type allows enabling/disabling the feature to ignore a byte
13680  between a 2-byte match abort pattern.
13681  Remarks:
13682  This feature may not be available on all devices. Refer to the specific device
13683  data sheet to determine availability.
13684 */
13685 
13686 typedef
13687  enum
13688  {
13689  /* Disabling the feature to ignore a byte between a 2-byte match abort pattern. */
13691  /* Enable the feature to ignore a byte between a 2-byte match abort pattern. */
13694 // *****************************************************************************
13695 /* DMA channel CRC mode
13696  Summary:
13697  Identifies the operation mode of the CRC module.
13698  Description:
13699  This data type identifies CRC operating mode. The CRC computation can be
13700  in background mode or append mode.
13701  Remarks:
13702  None.
13703 */
13704 
13705 typedef
13706  enum
13707  {
13708  /* DMA reads the data from the source, passes it through the CRC module and
13709  writes it to the destination. the calculated CRC is left in the DCRCDATA
13710  register at the end of the block transfer. */
13712  /* DMA only feeds source data to the CRC module. it does not write source data
13713  to the destination address. When a block transfer complete or pattern abort
13714  event occur, The DMA writes the CRC value to the destination address */
13717 // *****************************************************************************
13718 /* DMA channel CRC write order
13719  Summary:
13720  Identifies altering/maintaining write order post CRC computation.
13721  Description:
13722  This data type identifies write byte order selection post CRC
13723  computation.
13724  Remarks:
13725  None.
13726 */
13727 
13728 typedef
13729  enum
13730  {
13731  /* Source data is written to the destination unchanged regardless
13732  of the selected pre-CRC byte order. */
13734  /* Source data is written to the destination reordered according
13735  to the selected pre-CRC byte order. */
13738 // *****************************************************************************
13739 /* DMA channel operation modes
13740  Summary:
13741  Identifies the available DMA operating modes.
13742  Description:
13743  This data type Identifies the available DMA operating modes.
13744  The supported DMA modes are not mutually exclusive, but can be simultaneously
13745  operational.
13746  Remarks:
13747  These supported DMA modes can be logically OR'd together. They are passed
13748  into the SYS_DMA_ChannelSetup function through the modeEnable parameter.
13749 */
13750 
13751 typedef
13752  enum
13753  {
13754  /* The normal DMA operation mode. The DMA channel will transfer data from
13755  a source to a destination without CPU intervention */
13756  SYS_DMA_CHANNEL_OP_MODE_BASIC /*DOM-IGNORE-BEGIN*/
13757  = ( 1 << 0 ) /*DOM-IGNORE-END*/
13758  ,
13759  /* Pattern Match abort mode allows the user to end a transfer if data
13760  written during a transaction matches a specific pattern, as defined by
13761  the DCHxDAT register */
13763  = ( 1 << 1 ) /*DOM-IGNORE-END*/
13764  ,
13765  /* Channel chaining operating mode enhances the normal DMA channel
13766  operations. A channel(slave) can be chained to an adjacent channel(master).
13767  The slave channel will be enabled when a block transfer of the master
13768  channel completes. */
13769  /* only one of the below two chaining priorities must be provided.
13770  Chaining priority High. */
13772  = ( 1 << 2 ) /*DOM-IGNORE-END*/
13773  ,
13774  /* Chaining priority Low */
13776  = ( 1 << 3 ) /*DOM-IGNORE-END*/
13777  ,
13778  /* Auto enable operating mode allows a channel to be kept active, even if a
13779  block transfer completes or pattern match occurs. This prevents the user
13780  from having to re-enable the channel each time a block transfer completes. */
13781  SYS_DMA_CHANNEL_OP_MODE_AUTO/*DOM-IGNORE-BEGIN*/
13782  = ( 1 << 4 ) /*DOM-IGNORE-END*/
13783  ,
13784  /* CRC operating mode allows computation of 16, 32-bit CRC. */
13785  SYS_DMA_CHANNEL_OP_MODE_CRC/*DOM-IGNORE-BEGIN*/
13786  = ( 1 << 5 ) /*DOM-IGNORE-END*/
13788 // *****************************************************************************
13789 /* DMA channel CRC mode
13790  Summary:
13791  Defines the attributes for CRC operation mode.
13792  Description:
13793  This data type defines the attributes for CRC operation mode.
13794  Remarks:
13795  This feature may not be available on all devices. Refer to the specific device
13796  data sheet to determine availability.
13797 */
13798 
13799 typedef
13800  struct
13801  {
13802  /* CRC type (PLIB-level).
13803  Type Selection identifies whether the CRC module will calculate an IP
13804  header checksum or an LFSR CRC */
13805  DMA_CRC_TYPE type ;
13806  /* CRC mode, Background or Append */
13808  /* Polynomial length, This value is redundant when the selected CRC type is
13809  IP header checksum. When the CRC type is LFSR, Identifies the length of
13810  the polynomial. */
13811  uint8_t polyLength ;
13812  /* Bit order (PLIB-level).
13813  Identifies whether the CRC is computed LSb or MSb first */
13814  DMA_CRC_BIT_ORDER bitOrder ;
13815  /* Byte order (PLIB-level).
13816  Identifies the byte selection order input pre-CRC Generator. */
13817  DMA_CRC_BYTE_ORDER byteOrder ;
13818  /* Post CRC Write order */
13819  SYS_DMA_CRC_WRITE_ORDER writeOrder ;
13820  /* CRC data feed: While enabling the CRC mode, this field gives
13821  the seed for the CRC computation. On block transfer complete or
13822  pattern match abort the field have the computed CRC. */
13823  uint32_t data ;
13824  /* XOR bit mask, This value is redundant when the selected CRC type is
13825  IP header checksum. When the CRC type is LFSR, Identifies the XOR
13826  bit mask input to the shift register during CRC computation. */
13827  uint32_t xorBitMask ;
13829 // *****************************************************************************
13830 /* DMA System service Events
13831  Summary:
13832  Enumeration of possible DMA System service events.
13833  Description:
13834  This data type provides an enumeration of all possible DMA System service events.
13835  Remarks:
13836  None.
13837 */
13838 
13839 typedef
13840  enum
13841  {
13842  /* Data was transferred successfully. */
13844  /* Error while processing the request */
13846  /* Data transfer was aborted. */
13848  /* No events yet. */
13851 // *****************************************************************************
13852 /* DMA System service Error
13853  Summary:
13854  Indicates the error information for the DMA System service.
13855  Description:
13856  This enumeration indicates the error information for the DMA System service.
13857  Remarks:
13858  None.
13859 */
13860 
13861 typedef
13862  enum
13863  {
13864  /* Data was transferred successfully. */
13865  SYS_DMA_ERROR_NONE /*DOM-IGNORE-BEGIN*/
13866  = 1 << 0 ,
13867  /* DOM-IGNORE-END*/
13868  /* DMA address error. */
13869  SYS_DMA_ERROR_ADDRESS_ERROR /*DOM-IGNORE-BEGIN*/
13870  = 1 << 1 /* DOM-IGNORE-END*/
13871  } SYS_DMA_ERROR ;
13872 // *****************************************************************************
13873 /* DMA Initialization data
13874  Summary:
13875  Defines the data required to initialize the DMA subsystem.
13876  Description:
13877  This data type defines the data required to initialize the DMA subsystem.
13878  Remarks:
13879  This feature may not be available on all devices. Refer to the specific device
13880  data sheet to determine availability.
13881 */
13882 
13883 typedef
13884  struct
13885  {
13886  /* Enable/Disable stop in idle mode feature */
13887  SYS_DMA_SIDL sidl ;
13888  } SYS_DMA_INIT ;
13889 // *****************************************************************************
13890 /* Data width options */
13891 
13892 typedef
13893  enum
13894  {
13895  /* Data width configuration feature is not available */
13897  } SYS_DMA_DATA_WIDTH ;
13898 // *****************************************************************************
13899 /* DMA descriptor control
13900  Summary:
13901  Defines the descriptor control for linked list operation.
13902  Description:
13903  This data type defines the descriptor control for linked list operation.
13904  Remarks:
13905  This feature may not be available on all devices. Refer to the specific device
13906  data sheet to determine availability.
13907 */
13908 
13909 typedef
13910  union
13911  {
13912  /* Feature is not supported */
13913  ;
13915 // *****************************************************************************
13916 // *****************************************************************************
13917 // Section: Initialization and Task Functions
13918 // *****************************************************************************
13919 // *****************************************************************************
13920 //******************************************************************************
13921 /* Function:
13922  void SYS_DMA_Tasks(SYS_MODULE_OBJ object, DMA_CHANNEL activeChannel)
13923  Summary:
13924  Maintains the system service's state machine.
13925 
13926  Description:
13927  This function is used to maintain the DMA system service's internal state
13928  machine. This function services events on a specific DMA channel.
13929  Precondition:
13930  DMA should have been initialized by calling SYS_DMA_Initialize.
13931  Parameters:
13932  object - Object handle for the DMA module (returned from
13933  SYS_DMA_Initialize)
13934  activeChannel - DMA channel number to be serviced.
13935  Returns:
13936  None.
13937  Example:
13938  <code>
13939  // 'object' Returned from SYS_DMA_Initialize
13940  void __ISR(_DMA3_VECTOR,ipl5)_InterruptHandler_BT_USART_RX_DMA_CHANNEL(void)
13941  {
13942  SYS_DMA_Tasks(object, DMA_CHANNEL_3);
13943  }
13944  </code>
13945  Remarks:
13946  This function is normally not called directly by an application. It is
13947  called by the system's task/interrupt routines.
13948  */
13949 
13950 void
13951  SYS_DMA_Tasks (
13952  SYS_MODULE_OBJ object ,
13953  DMA_CHANNEL activeChannel ) ;
13954 //******************************************************************************
13955 /* For backward compatibility */
13956 #define SYS_DMA_TasksISR( object , activeChannel ) SYS_DMA_Tasks ( object , activeChannel )
13957  // #ifndef _SYS_DMA_DEFINITIONS_H
13958 /*******************************************************************************
13959  End of File
13960 */
13961 #endif /*00 C:\microchip\harmony\v2_06\framework\system\dma\sys_dma_definitions.h*/
13962 /* CLOSE_FILE Include File */
13963 
13964 // DOM-IGNORE-BEGIN
13965 // DOM-IGNORE-END
13966 // *****************************************************************************
13967 // *****************************************************************************
13968 // Section: DMA System Service Interface Routines
13969 // *****************************************************************************
13970 // *****************************************************************************
13971 // *****************************************************************************
13972 /* DMA System service Transfer Event Handler Function
13973  Summary:
13974  Pointer to a DMA System service Transfer Event handler function.
13975  Description:
13976  This data type defines a DMA System service Transfer Event Handler Function.
13977  A DMA system service client must register an transfer event handler function of
13978  this type to receive transfer related events from the system service.
13979  If the event is SYS_DMA_TRANSFER_EVENT_COMPLETE, this means that the data
13980  was transferred successfully. The channelHandle parameter contains the channel
13981  handle of the channel on which the transfer was processed.
13982  If the event is SYS_DMA_TRANSFER_EVENT_ERROR, this means that the data was
13983  not transferred successfully. TThe channelHandle parameter contains the channel
13984  handle of the channel on which the transfer had failed.
13985  The contextHandle parameter contains the context handle that was provided by
13986  the client at the time of registering the event handler. This context handle
13987  can be anything that the client consider helpful or necessary to identify
13988  the client context object associated with the channel of the system
13989  service that generated the event.
13990  The event handler function executes in an interrupt context when DMA is setup
13991  to start operation by an interrupt trigger source. It is recommended of the
13992  application to not perform process intensive operations with in this
13993  function.
13994  Remarks:
13995  None.
13996 */
13997 
13998 typedef
14000 SYS_DMA_CHANNEL_HANDLE handle ,
14001 uintptr_t contextHandle ) ;
14002 // *****************************************************************************
14003 // *****************************************************************************
14004 // Section: Initialization and Task Functions
14005 // *****************************************************************************
14006 // *****************************************************************************
14007 //******************************************************************************
14008 /* Function:
14009  SYS_MODULE_OBJ SYS_DMA_Initialize(const SYS_MODULE_INIT * const init)
14010  Summary:
14011  Initializes and Enables the DMA Controller.
14012  Description:
14013  This function Enables the DMA module. Enable/Disable stop in idle mode
14014  feature based on the passed parameter value.
14015  This function initializes the DMA module making it ready for clients to
14016  open and use it. The initialization data is specified by the init parameter.
14017  Precondition:
14018  None.
14019  Parameters:
14020  init - Pointer to the data structure containing any data
14021  necessary to initialize the hardware. This pointer may
14022  be null if no data is required and default
14023  initialization is to be used.
14024  Returns:
14025  If successful, returns a valid handle to the DMA module object.
14026  Otherwise, it returns SYS_MODULE_OBJ_INVALID.
14027  Example:
14028  <code>
14029  SYS_MODULE_OBJ objectHandle;
14030  SYS_DMA_INIT initParam;
14031  initParam.sidl = SYS_DMA_SIDL_ENABLE;
14032  objectHandle = SYS_DMA_Initialize(DRV_I2S_INDEX_1,
14033  (SYS_MODULE_INIT*)initParam);
14034  if (SYS_MODULE_OBJ_INVALID == objectHandle)
14035  {
14036  // Handle error
14037  }
14038  </code>
14039  Remarks:
14040  This function must be called before any other DMA systems service routines
14041  are called.
14042  Not all features are available on all micro-controllers.
14043 */
14044 
14045 SYS_MODULE_OBJ
14047  const SYS_MODULE_INIT * const init ) ;
14048 // *****************************************************************************
14049 // *****************************************************************************
14050 // Section: Channel Setup and management functions
14051 // *****************************************************************************
14052 // *****************************************************************************
14053 //******************************************************************************
14054 /* Function:
14055  SYS_DMA_CHANNEL_HANDLE SYS_DMA_ChannelAllocate (DMA_CHANNEL channel)
14056  Summary:
14057  Allocates the specified DMA channel and returns a handle to it.
14058  Description:
14059  This function opens the specified DMA channel and provides a
14060  handle that must be provided to all other client-level operations to
14061  identify the caller and the DMA channel.
14062  Precondition:
14063  Function SYS_DMA_Initialize must have been called before calling this
14064  function.
14065  Parameters:
14066  channel - Channel number requested for allocation.
14067  When channel number specified is DMA_CHANNEL_ANY
14068  a random channel is allocated for DMA transfers.
14069  Returns:
14070  The channel handle for the requested channel number.
14071  If an error occurs, the return value is SYS_DMA_CHANNEL_HANDLE_INVALID.
14072  Error can occur.
14073  - if the requested channel number is invalid.
14074  - if the requested channel number is not free.
14075  Example:
14076  <code>
14077  DMA_CHANNEL channel;
14078  SYS_DMA_CHANNEL_HANDLE handle
14079  channel = DMA_CHANNEL_2;
14080  handle = SYS_DMA_ChannelAllocate(channel);
14081  if (SYS_DMA_CHANNEL_HANDLE_INVALID == handle)
14082  {
14083  // Failed to allocate the channel
14084  }
14085  else
14086  {
14087  // Proceed with setting up the channel and adding the transfer
14088  }
14089  </code>
14090  Remarks:
14091  The handle returned is valid until the SYS_DMA_ChannelRelease routine is called.
14092  This function must be called before any other DMA channel Setup and management
14093  routines are called
14094 */
14095 
14098  DMA_CHANNEL channel ) ;
14099 //******************************************************************************
14100 /* Function:
14101  void SYS_DMA_ChannelRelease(SYS_DMA_CHANNEL_HANDLE handle)
14102  Summary:
14103  Deallocates and frees the channel specified by the handle.
14104  Description:
14105  This function deallocates an allocated-channel of the DMA module,
14106  invalidating the handle.
14107  Precondition:
14108  DMA should have been initialized by calling SYS_DMA_Initialize.
14109  DMA channel should have been allocated by calling SYS_DMA_ChannelAllocate
14110  Parameters:
14111  handle - A valid allocated-channel handle, returned from the service's
14112  Allocate routine
14113  Returns:
14114  None.
14115  Example:
14116  <code>
14117  DMA_CHANNEL channel;
14118  SYS_DMA_CHANNEL_HANDLE handle;
14119  channel = DMA_CHANNEL_2;
14120  handle = SYS_DMA_ChannelAllocate(channel);
14121  SYS_DMA_ChannelRelease(handle);
14122  </code>
14123  Remarks:
14124  After calling this routine, the handle passed in "handle" must not be used
14125  with any of the remaining service's routines. A new handle must be obtained by
14126  calling SYS_DMA_ChannelAllocate before the caller may use the service again
14127 */
14128 
14129 void
14131  SYS_DMA_CHANNEL_HANDLE handle ) ;
14132 //******************************************************************************
14133 /* Function:
14134  void SYS_DMA_ChannelSetup
14135  (
14136  SYS_DMA_CHANNEL_HANDLE handle,
14137  SYS_DMA_CHANNEL_OP_MODE modeEnable
14138  DMA_TRIGGER_SOURCE eventSrc
14139  )
14140  Summary:
14141  Setup the DMA channel parameters.
14142  Description:
14143  This function sets up the DMA channel parameters.
14144  It sets the channel priority and enables the mode of operations for the
14145  current system design.
14146  Precondition:
14147  DMA should have been initialized by calling SYS_DMA_Initialize.
14148  DMA channel should have been allocated by calling SYS_DMA_ChannelAllocate.
14149  Parameters:
14150  handle - Handle of the DMA channel as returned by the
14151  SYS_DMA_ChannelAllocate function.
14152  priority - The priority to be associated to the channel.
14153  modeEnable - The supported operating modes to be enabled.
14154  This parameter can be logically ORed to specify
14155  multiple options.
14156  eventSrc - The event causing the cell transfer start.
14157  Returns:
14158  None.
14159  Example:
14160  <code>
14161  // 'handle' is a valid handle returned
14162  // by the SYS_DMA_ChannelAllocate function.
14163  SYS_DMA_CHANNEL_OP_MODE modeEnable;
14164  DMA_TRIGGER_SOURCE eventSrc;
14165  channel = DMA_CHANNEL_2;
14166  modeEnable = (SYS_DMA_CHANNEL_OP_MODE_BASIC | SYS_DMA_CHANNEL_OP_MODE_CRC);
14167  eventSrc = DMA_TRIGGER_USART_1_TRANSMIT;
14168  // Setup channel number, and enables basic and CRC mode
14169  SYS_DMA_ChannelSetup(handle, modeEnable,eventSrc);
14170  </code>
14171  Remarks:
14172  If SYS_DMA_CHANNEL_OP_MODE_MATCH_ABORT, SYS_DMA_CHANNEL_OP_MODE_CHAIN or
14173  SYS_DMA_CHANNEL_OP_MODE_CRC mode of operation is enabled, then corresponding
14174  mode setup API's needs to be called to set the related parameters.
14175  If the parameter 'eventSrc' is specified as DMA_TRIGGER_SOURCE_NONE then
14176  SYS_DMA_ChannelForceStart must be called to start the DMA channel transfer.
14177  Not all features are available on all microcontrollers.
14178  */
14179 
14180 void
14182  SYS_DMA_CHANNEL_HANDLE handle ,
14183  SYS_DMA_CHANNEL_OP_MODE modeEnable ,
14184  DMA_TRIGGER_SOURCE eventSrc ) ;
14185 //******************************************************************************
14186 /* Function:
14187  void SYS_DMA_ChannelSetupMatchAbortMode
14188  (
14189  SYS_DMA_CHANNEL_HANDLE handle,
14190  uint16_t pattern,
14191  DMA_PATTERN_LENGTH length,
14192  SYS_DMA_CHANNEL_IGNORE_MATCH ignore,
14193  uint8_t ignorePattern
14194  )
14195  Summary:
14196  Setup the pattern match abort mode.
14197  Description:
14198  This function sets up the termination of DMA operation when the specified
14199  pattern is matched. Additionally on supported parts the function also
14200  sets up the ignoring of part of a pattern(8-bit) from match abort
14201  pattern(16-bit).
14202  Precondition:
14203  DMA should have been initialized by calling SYS_DMA_Initialize.
14204  DMA channel should have been allocated by calling SYS_DMA_ChannelAllocate.
14205  The function SYS_DMA_ChannelSetup must be called to enable
14206  SYS_DMA_CHANNEL_OP_MODE_MATCH_ABORT before setting up pattern
14207  match mode features.
14208  Parameters:
14209  handle - Handle of the DMA channel as returned by the
14210  SYS_DMA_ChannelAllocate function.
14211  pattern - The pattern that needs to be matched to abort a DMA transfer.
14212  length - Match pattern length can be 1-byte or 2-byte.
14213  ignore - Enable/Disable a byte between a 2-byte pattern match.
14214  ignorePattern - The part of the pattern(8-bit) that needs to be ignored
14215  from the match abort pattern(16-bit)
14216  Returns:
14217  None.
14218  Example:
14219  <code>
14220  // Example 1
14221  // The following code is for a device with an 8-bit pattern value and no
14222  // support for pattern match ignore feature
14223  // 'handle' is a valid handle returned
14224  // by the SYS_DMA_ChannelAllocate function.
14225  uint16_t pattern;
14226  DMA_PATTERN_LENGTH length;
14227  SYS_DMA_CHANNEL_IGNORE_MATCH ignore;
14228  uint8_t ignorePattern;
14229  pattern = 0x00; //Stop transfer on detection of a NULL character
14230  length = DMA_PATTERN_LENGTH_NONE;
14231  ignore = SYS_DMA_CHANNEL_IGNORE_MATCH_DISABLE;
14232  ignorePattern = 0;
14233  SYS_DMA_ChannelSetupMatchAbortMode(handle, pattern, length,
14234  ignoreEnable, ignorePattern);
14235  // Example 2
14236  // The following code is for a device with a 16-bit pattern value and
14237  // support for pattern match ignore feature
14238  // 'handle' is a valid handle returned
14239  // by the SYS_DMA_ChannelAllocate function.
14240  uint16_t pattern;
14241  DMA_PATTERN_LENGTH length;
14242  SYS_DMA_CHANNEL_IGNORE_MATCH ignore;
14243  uint8_t ignorePattern;
14244  pattern = 0x0D0A; //Stop transfer on detection of '\r\n'
14245  length = DMA_PATTERN_MATCH_LENGTH_2BYTES;
14246  ignore = SYS_DMA_CHANNEL_IGNORE_MATCH_ENABLE;
14247  ignorePattern = 0x00; \\ Any null character between the termination pattern
14248  \\ '\r' and '\n' is ignored.
14249  SYS_DMA_ChannelSetupMatchAbortMode(handle, pattern, length,
14250  ignore, ignorePattern);
14251  </code>
14252  Remarks:
14253  The parameter 'pattern' (8-bit or 16-bit) is device-specific.
14254  Not all features are available on all devices.
14255  Refer to the specific device data sheet for details.
14256 */
14257 
14258 void
14260  SYS_DMA_CHANNEL_HANDLE handle ,
14261  uint16_t pattern ,
14262  DMA_PATTERN_LENGTH length ,
14264  uint8_t ignorePattern ) ;
14265 //******************************************************************************
14266 /* Function:
14267  void SYS_DMA_ChannelCRCSet
14268  (
14269  SYS_DMA_CHANNEL_HANDLE handle,
14270  SYS_DMA_CHANNEL_OPERATION_MODE_CRC crc
14271  )
14272  Summary:
14273  Sets up the CRC operation mode.
14274  Description:
14275  This function sets up the CRC computation features.
14276  Precondition:
14277  DMA should have been initialized by calling SYS_DMA_Initialize.
14278  DMA channel should have been allocated by calling SYS_DMA_ChannelAllocate.
14279  The function SYS_DMA_ChannelSetup must be called to enable
14280  SYS_DMA_CHANNEL_OP_MODE_CRC before setting up the CRC mode.
14281  Parameters:
14282  handle - Handle of the DMA channel as returned by the
14283  SYS_DMA_ChannelAllocate function.
14284  crc.type - CRC will calculate an IP header checksum or an LFSR CRC.
14285  crc.mode - Compute the CRC in Background/Append mode.
14286  crc.polyLength - Denotes the length of the polynomial.
14287  crc.bitOrder - CRC is calculated LSb/MSb first.
14288  crc.byteOrder - Byte selection order input pre-CRC Generator
14289  crc.writeOrder - Write byte order selection post-CRC computation
14290  crc.data - Computed/Seed CRC
14291  crc.xorBitMask - Enable/Disable XOR bit mask on the corresponding bits
14292  when mode is LFSR
14293  Returns:
14294  None.
14295  Example:
14296  <code>
14297  //Example 1
14298  // DMA calculation using the CRC background mode
14299  // 'handle' is a valid handle returned
14300  // by the SYS_DMA_ChannelAllocate function.
14301  SYS_DMA_CHANNEL_OPERATION_MODE_CRC crc;
14302  crc.type = DMA_CRC_LFSR;
14303  crc.mode = SYS_DMA_CHANNEL_CRC_MODE_BACKGROUND;
14304  crc.polyLength = 16;
14305  crc.bitOrder = DMA_CRC_BIT_ORDER_LSB;
14306  crc.byteOrder = DMA_CRC_BYTEORDER_NO_SWAPPING;
14307  crc.writeOrder = SYS_DMA_CRC_WRITE_ORDER_MAINTAIN;
14308  crc.data = 0xFFFF;
14309  crc.xorBitMask = 0x1021;
14310  SYS_DMA_ChannelCRCSet(handle, crc);
14311  </code>
14312  Remarks:
14313  This feature may not be available on all devices. Refer to the specific device
14314  data sheet to determine availability.
14315 */
14316 
14317 void
14319  SYS_DMA_CHANNEL_HANDLE handle ,
14321 //******************************************************************************
14322 /* Function:
14323  uint32_t SYS_DMA_ChannelCRCGet(void)
14324  Summary:
14325  Returns the computed CRC.
14326  Description:
14327  This function returns the computed CRC
14328  Precondition:
14329  DMA should have been initialized by calling SYS_DMA_Initialize.
14330  DMA channel should have been allocated by calling SYS_DMA_ChannelAllocate.
14331  The function SYS_DMA_ChannelSetup must be called to enable
14332  SYS_DMA_CHANNEL_OP_MODE_CRC before setting up the CRC mode.
14333  The CRC generator must have been previously setup using
14334  SYS_DMA_ChannelCRCSet.
14335  Parameters:
14336  None
14337  Returns:
14338  uint32_t - The Computed CRC.
14339  Example:
14340  <code>
14341  uint32_t computedCRC;
14342  computedCRC = SYS_DMA_ChannelCRCGet();
14343  </code>
14344  Remarks:
14345  To get the computed CRC value this function must be called after the block
14346  transfer completion event (i.e., after getting and processing the callback
14347  registered with SYS_DMA_ChannelTransferEventHandlerSet).
14348  This feature may not be available on all devices. Refer to the specific device
14349  data sheet to determine availability.
14350 */
14351 
14352 uint32_t
14353  SYS_DMA_ChannelCRCGet ( void ) ;
14354 //******************************************************************************
14355 /* Function:
14356  void SYS_DMA_ChannelEnable(SYS_DMA_CHANNEL_HANDLE handle)
14357  Summary:
14358  Enables a channel.
14359  Description:
14360  This function enables a channel.
14361  Precondition:
14362  DMA should have been initialized by calling SYS_DMA_Initialize.
14363  DMA channel should have been allocated by calling SYS_DMA_ChannelAllocate.
14364  The function SYS_DMA_ChannelSetup must have been called to setup and
14365  enable the required features.
14366  Parameters:
14367  handle - Handle of the DMA channel as returned by the
14368  SYS_DMA_ChannelAllocate function.
14369  Returns:
14370  None.
14371  Example:
14372  <code>
14373  // 'handle' is a valid handle returned
14374  // by the SYS_DMA_ChannelAllocate function.
14375  SYS_DMA_ChannelEnable(handle);
14376  </code>
14377  Remarks:
14378  This function may not required to be called when starting DMA setup
14379  (by SYS_DMA_ChannelSetup) and transfer Add (by SYS_DMA_ChannelTransferAdd).
14380  But may be needed to be called in the registered callback to enable the
14381  channel and continue the data transfer with the existing transfer parameters
14382  previously set with 'SYS_DMA_ChannelTransferAdd'.
14383  The DMA channel is by default disabled on the completion of block
14384  transfer(callback generated)
14385 */
14386 
14387 void
14389  SYS_DMA_CHANNEL_HANDLE handle ) ;
14390 //******************************************************************************
14391 /* Function:
14392  void SYS_DMA_ChannelDisable(SYS_DMA_CHANNEL_HANDLE handle)
14393  Summary:
14394  Disables a channel.
14395  Description:
14396  This function disables a channel.
14397  Precondition:
14398  DMA should have been initialized by calling SYS_DMA_Initialize.
14399  DMA channel should have been allocated by calling SYS_DMA_ChannelAllocate.
14400  The function SYS_DMA_ChannelSetup must have been called to setup and
14401  enable the required features.
14402  A DMA channel should have been enabled either by calling
14403  'SYS_DMA_ChannelTransferAdd' or 'SYS_DMA_ChannelEnable'
14404  Parameters:
14405  handle - Handle of the DMA channel as returned by the
14406  SYS_DMA_ChannelAllocate function.
14407  Returns:
14408  None.
14409  Example:
14410  <code>
14411  // 'handle' is a valid handle returned
14412  // by the SYS_DMA_ChannelAllocate function.
14413  SYS_DMA_ChannelDisable(handle);
14414  </code>
14415  Remarks:
14416  None.
14417 */
14418 
14419 void
14421  SYS_DMA_CHANNEL_HANDLE handle ) ;
14422 //******************************************************************************
14423 /* Function:
14424  void SYS_DMA_ChannelTransferAdd
14425  (
14426  SYS_DMA_CHANNEL_HANDLE handle,
14427  const void *srcAddr, size_t srcSize
14428  const void *destAddr, size_t destSize,
14429  size_t cellSize
14430  )
14431  Summary:
14432  Adds a data transfer to a DMA channel and Enables the channel to start
14433  data transfer.
14434  Description:
14435  This function adds a data transfer characteristics for a DMA channel. The
14436  The source and the destination addresses, source and destination lengths,
14437  The number of bytes transferred per cell event are set. It also enables
14438  the channel to start data transfer.
14439  If the requesting client registered an event callback with the service,
14440  the service will issue a SYS_DMA_TRANSFER_EVENT_COMPLETE or
14441  SYS_DMA_TRANSFER_EVENT_ABORT event if the transfered was processed
14442  successfully of SYS_DMA_TRANSFER_EVENT_ERROR event if the transfer was not
14443  processed successfully.
14444  Precondition:
14445  DMA should have been initialized by calling SYS_DMA_Initialize.
14446  DMA channel should have been allocated by calling SYS_DMA_ChannelAllocate.
14447  The function SYS_DMA_ChannelSetup must have been called to setup and
14448  enable the required features.
14449  Parameters:
14450  handle - Handle of the DMA channel as returned by the
14451  SYS_DMA_ChannelAllocate function.
14452  srcAddr - Source of the DMA transfer
14453  srcSize - Size of the source
14454  destAddr - Destination of the DMA transfer
14455  destSize - Size of the destination
14456  cellSize - Size of the cell
14457  Returns:
14458  None.
14459  Example:
14460  <code>
14461  // Add 10 bytes of data transfer to UART TX
14462  // 'handle' is a valid handle returned
14463  // by the SYS_DMA_ChannelAllocate function.
14464  MY_APP_OBJ myAppObj;
14465  uint8_t buf[10];
14466  void *srcAddr;
14467  void *destAddr;
14468  size_t srcSize;
14469  size_t destSize;
14470  size_t cellSize;
14471  srcAddr = (uint8_t *) buf;
14472  srcSize = 10;
14473  destAddr = (uin8_t*) &U2TXREG;
14474  destSize = 1;
14475  cellSize = 1;
14476  // User registers an event handler with system service. This is done once
14477  SYS_DMA_ChannelTransferEventHandlerSet(handle, APP_DMASYSTransferEventHandler,
14478  (uintptr_t)&myAppObj);
14479  SYS_DMA_ChannelTransferAdd(handle,srcAddr,srcSize,destAddr,destSize,cellSize);
14480  if(SYS_DMA_CHANNEL_HANDLE_INVALID == handle)
14481  {
14482  // Error handling here
14483  }
14484  // Event Processing Technique. Event is received when
14485  // the transfer is processed.
14486  void APP_DMASYSTransferEventHandler(SYS_DMA_TRANSFER_EVENT event,
14487  SYS_DMA_CHANNEL_HANDLE handle, uintptr_t contextHandle)
14488  {
14489  switch(event)
14490  {
14491  case SYS_DMA_TRANSFER_EVENT_COMPLETE:
14492  // This means the data was transferred.
14493  break;
14494  case SYS_DMA_TRANSFER_EVENT_ERROR:
14495  // Error handling here.
14496  break;
14497  default:
14498  break;
14499  }
14500  }
14501  </code>
14502  Remarks:
14503  For PIC32MZ series of devices, if the source/destination addresses are
14504  RAM memory addresses, the the source/destination buffers
14505  should be made coherent to avoid the cache coherency issues.
14506  For example:
14507  <code>
14508  uint8_t buffer[1024];
14509  // The buffer can be made coherent by adding the 'coherent' attribute, as follows:
14510  uint8_t __attribute__((coherent)) __attribute__((aligned(16))) buffer[1024];
14511  </code>
14512 */
14513 
14514 void
14516  SYS_DMA_CHANNEL_HANDLE handle ,
14517  const void * srcAddr ,
14518  size_t srcSize ,
14519  const void * destAddr ,
14520  size_t destSize ,
14521  size_t cellSize ) ;
14522 //******************************************************************************
14523 /* Function:
14524  void SYS_DMA_ChannelTransferSet
14525  (
14526  SYS_DMA_CHANNEL_HANDLE handle,
14527  const void *srcAddr, size_t srcSize
14528  const void *destAddr, size_t destSize,
14529  size_t cellSize
14530  )
14531  Summary:
14532  Sets up a data transfer to a DMA channel.
14533  Description:
14534  This function sets up data transfer characteristics for a DMA channel. The
14535  The source and the destination addresses, source and destination lengths,
14536  The number of bytes transferred per cell event are set.
14537  This function does not enables the DMA channel. The channel has to be explicitly
14538  enabled to start the data transfer.
14539  The above functions could be used in situations where in the user intends to
14540  setup transfer parameters but do not intend to enable the channel immediately.
14541  For example to chain to DMA channels in a cyclic order where the channels remains
14542  disabled. The channel is enabled automatically by the DMA when the transfer trigger
14543  condition occurs.
14544  Precondition:
14545  DMA should have been initialized by calling SYS_DMA_Initialize.
14546  DMA channel should have been allocated by calling SYS_DMA_ChannelAllocate.
14547  The function SYS_DMA_ChannelSetup must have been called to setup and
14548  enable the required features.
14549  Parameters:
14550  handle - Handle of the DMA channel as returned by the
14551  SYS_DMA_ChannelAllocate function.
14552  srcAddr - Source of the DMA transfer
14553  srcSize - Size of the source
14554  destAddr - Destination of the DMA transfer
14555  destSize - Size of the destination
14556  cellSize - Size of the cell
14557  Returns:
14558  None.
14559  Example:
14560  <code>
14561  // Set up 10 bytes of data transfer to UART TX
14562  // 'handle' is a valid handle returned
14563  // by the SYS_DMA_ChannelAllocate function.
14564  MY_APP_OBJ myAppObj;
14565  uint8_t buf[10];
14566  void *srcAddr;
14567  void *destAddr;
14568  size_t srcSize;
14569  size_t destSize;
14570  size_t cellSize;
14571  srcAddr = (uint8_t *) buf;
14572  srcSize = 10;
14573  destAddr = (uin8_t*) &U2TXREG;
14574  destSize = 1;
14575  cellSize = 1;
14576  // User registers an event handler with system service. This is done once
14577  SYS_DMA_ChannelTransferEventHandlerSet(handle, APP_DMASYSTransferEventHandler,
14578  (uintptr_t)&myAppObj);
14579  SYS_DMA_ChannelTransferSet(handle,srcAddr,srcSize,destAddr,destSize,cellSize);
14580  SYS_DMA_ChannelEnable(handle);
14581  if(SYS_DMA_CHANNEL_HANDLE_INVALID == handle)
14582  {
14583  // Error handling here
14584  }
14585  // Event Processing Technique. Event is received when
14586  // the transfer is processed.
14587  void APP_DMASYSTransferEventHandler(SYS_DMA_TRANSFER_EVENT event,
14588  SYS_DMA_CHANNEL_HANDLE handle, uintptr_t contextHandle)
14589  {
14590  switch(event)
14591  {
14592  case SYS_DMA_TRANSFER_EVENT_COMPLETE:
14593  // This means the data was transferred.
14594  break;
14595  case SYS_DMA_TRANSFER_EVENT_ERROR:
14596  // Error handling here.
14597  break;
14598  default:
14599  break;
14600  }
14601  }
14602  </code>
14603  Remarks:
14604  For PIC32MZ series of devices, if the source/destination addresses are
14605  RAM memory addresses, the the source/destination buffers
14606  should be made coherent to avoid the cache coherency issues.
14607  For example:
14608  <code>
14609  uint8_t buffer[1024];
14610  // The buffer can be made coherent by adding the 'coherent' attribute, as follows:
14611  uint8_t __attribute__((coherent)) __attribute__((aligned(16))) buffer[1024];
14612  </code>
14613 */
14614 
14615 void
14617  SYS_DMA_CHANNEL_HANDLE handle ,
14618  const void * srcAddr ,
14619  size_t srcSize ,
14620  const void * destAddr ,
14621  size_t destSize ,
14622  size_t cellSize ) ;
14623 //******************************************************************************
14624 /* Function:
14625  size_t SYS_DMA_ChannelSourceTransferredSizeGet(SYS_DMA_CHANNEL_HANDLE handle)
14626  Summary:
14627  Returns the number of bytes transferred from source.
14628  Description:
14629  When a data transfer request is submitted. At any time while the transmission
14630  is in progress the size of the amount of data transferred from source
14631  can be known by calling this function.
14632  Precondition:
14633  DMA should have been initialized by calling SYS_DMA_Initialize.
14634  DMA channel should have been allocated by calling SYS_DMA_ChannelAllocate.
14635  Data transfer should have been initiated by calling SYS_DMA_ChannelTransferAdd or
14636  SYS_DMA_ChannelTransferSet.
14637  Parameters:
14638  handle - A valid channel handle, returned from the system service's
14639  Allocate routine
14640  Returns:
14641  size_t - Returns the number of bytes transferred from the submitted size.
14642  Example:
14643  <code>
14644  // 'handle' is a valid handle returned
14645  // by the SYS_DMA_ChannelAllocate function.
14646  MY_APP_OBJ myAppObj;
14647  uint8_t buf[10];
14648  void *srcAddr;
14649  void *destAddr;
14650  size_t srcSize;
14651  size_t destSize;
14652  size_t cellSize;
14653  size_t transferredSize;
14654  srcAddr = (uint8_t *) buf;
14655  srcSize = 10;
14656  destAddr = (uin8_t*) &U2TXREG;
14657  destSize = 1;
14658  cellSize = 1;
14659  channelHandle = SYS_DMA_ChannelAllocate(channel);
14660  // User registers an event handler with system service. This is done once
14661  SYS_DMA_ChannelTransferEventHandlerSet(handle, APP_DMASYSTransferEventHandler,
14662  (uintptr_t)&myAppObj);
14663  SYS_DMA_ChannelTransferAdd(handle,srcAddr,srcSize,destAddr,destSize,cellSize);
14664  if(SYS_DMA_CHANNEL_HANDLE_INVALID == handle)
14665  {
14666  // Error handling here
14667  }
14668  // The data is being transferred after adding the transfer to the DMA channel.
14669  // The user can get to know dynamically the amount of data
14670  // transmitted from source by calling SYS_DMA_ChannelSourceTransferredSizeGet
14671  transferredSize = SYS_DMA_ChannelSourceTransferredSizeGet(channelHandle);
14672  </code>
14673  Remarks:
14674  None.
14675 */
14676 
14677 size_t
14679  SYS_DMA_CHANNEL_HANDLE handle ) ;
14680 //******************************************************************************
14681 /* Function:
14682  size_t SYS_DMA_ChannelDestinationTransferredSizeGet(SYS_DMA_CHANNEL_HANDLE handle)
14683  Summary:
14684  Returns the number of bytes transferred to destination.
14685  Description:
14686  When a data transfer request is submitted. At any time while the transmission
14687  is in progress the size of the amount of data transferred to destination
14688  can be known by calling this function.
14689  Precondition:
14690  DMA should have been initialized by calling SYS_DMA_Initialize.
14691  DMA channel should have been allocated by calling SYS_DMA_ChannelAllocate.
14692  Data transfer should have been initiated by calling SYS_DMA_ChannelTransferAdd or
14693  SYS_DMA_ChannelTransferSet.
14694  Parameters:
14695  handle - A valid channel handle, returned from the system service's
14696  Allocate routine
14697  Returns:
14698  size_t - Returns the number of bytes received from the submitted size.
14699  Example:
14700  <code>
14701  // 'handle' is a valid handle returned
14702  // by the SYS_DMA_ChannelAllocate function.
14703  MY_APP_OBJ myAppObj;
14704  uint8_t buf[10];
14705  void *srcAddr;
14706  void *destAddr;
14707  size_t srcSize;
14708  size_t destSize;
14709  size_t cellSize;
14710  size_t transferredSize;
14711  srcAddr = (uin8_t*) &U2RXREG;
14712  srcSize = 1;
14713  destAddr = (uint8_t *) buf ;
14714  destSize = 10;
14715  cellSize = 1;
14716  channelHandle = SYS_DMA_ChannelAllocate(channel);
14717  // User registers an event handler with system service. This is done once
14718  SYS_DMA_ChannelTransferEventHandlerSet(handle, APP_DMASYSTransferEventHandler,
14719  (uintptr_t)&myAppObj);
14720  SYS_DMA_ChannelTransferAdd(handle,srcAddr,srcSize,destAddr,destSize,cellSize);
14721  if(SYS_DMA_CHANNEL_HANDLE_INVALID == handle)
14722  {
14723  // Error handling here
14724  }
14725  // The data is being transferred after adding the transfer to the DMA channel.
14726  // The user can get to know dynamically the amount of data
14727  // transmitted to destination by calling SYS_DMA_ChannelDestinationTransferredSizeGet
14728  transferredSize = SYS_DMA_ChannelDestinationTransferredSizeGet(channelHandle);
14729  </code>
14730  Remarks:
14731  None.
14732 */
14733 
14734 size_t
14736  SYS_DMA_CHANNEL_HANDLE handle ) ;
14737 //******************************************************************************
14738 /*
14739  Function:
14740  void SYS_DMA_ChannelTransferEventHandlerSet
14741  (
14742  SYS_DMA_CHANNEL_HANDLE handle,
14743  const SYS_DMA_CHANNEL_TRANSFER_EVENT_HANDLER eventHandler,
14744  const uintptr_t contextHandle
14745  )
14746  Summary:
14747  This function allows a DMA system service client to set an event handler.
14748  Description:
14749  This function allows a client to set an event handler. The client may want
14750  to receive transfer related events in cases when it uses non-blocking read and
14751  write functions. The event handler should be set before the client
14752  intends to perform operations that could generate events.
14753  This function accepts a contextHandle parameter. This parameter could be
14754  set by the client to contain (or point to) any client specific data object
14755  that should be associated with this DMA channel.
14756  Precondition:
14757  DMA should have been initialized by calling SYS_DMA_Initialize.
14758  DMA channel should have been allocated by calling SYS_DMA_ChannelAllocate.
14759  Parameters:
14760  handle - A valid channel handle, returned from the system service's
14761  Allocate routine
14762  eventHandler - Pointer to the event handler function.
14763  contextHandle - Value identifying the context of the application/driver/middleware
14764  that registered the event handling function.
14765  Returns:
14766  None.
14767  Example:
14768  <code>
14769  // 'handle' is a valid handle returned
14770  // by the SYS_DMA_ChannelAllocate function.
14771  MY_APP_OBJ myAppObj;
14772  uint8_t buf[10];
14773  void *srcAddr;
14774  void *destAddr;
14775  size_t srcSize;
14776  size_t destSize;
14777  size_t cellSize;
14778  srcAddr = (uint8_t *) buf;
14779  srcSize = 10;
14780  destAddr = (uin8_t*) &U2TXREG;
14781  destSize = 1;
14782  cellSize = 1;
14783  channelHandle = SYS_DMA_ChannelAllocate(channel);
14784  // User registers an event handler with system service. This is done once
14785  SYS_DMA_ChannelTransferEventHandlerSet(handle, APP_DMASYSTransferEventHandler,
14786  (uintptr_t)&myAppObj);
14787  SYS_DMA_ChannelTransferAdd(handle,srcAddr,srcSize,destAddr,destSize,cellSize);
14788  if(SYS_DMA_CHANNEL_HANDLE_INVALID == handle)
14789  {
14790  // Error handling here
14791  }
14792  // Event Processing Technique. Event is received when
14793  // the transfer is processed.
14794  void APP_DMASYSTransferEventHandler(SYS_DMA_TRANSFER_EVENT event,
14795  SYS_DMA_CHANNEL_HANDLE handle, uintptr_t contextHandle)
14796  {
14797  switch(event)
14798  {
14799  case SYS_DMA_TRANSFER_EVENT_COMPLETE:
14800  // This means the data was transferred.
14801  break;
14802  case SYS_DMA_TRANSFER_EVENT_ERROR:
14803  // Error handling here.
14804  break;
14805  default:
14806  break;
14807  }
14808  }
14809  </code>
14810  Remarks:
14811  None.
14812  */
14813 
14814 void
14816  SYS_DMA_CHANNEL_HANDLE handle ,
14817  const SYS_DMA_CHANNEL_TRANSFER_EVENT_HANDLER eventHandler ,
14818  const uintptr_t contextHandle ) ;
14819 // *****************************************************************************
14820 /* Function:
14821  SYS_DMA_ERROR SYS_DMA_ChannelErrorGet(SYS_DMA_CHANNEL_HANDLE handle)
14822  Summary:
14823  This function returns the error(if any) associated with the last client
14824  request.
14825  Description:
14826  This function returns the error(if any) associated with the last client
14827  request. If the service send a SYS_DMA_TRANSFER_EVENT_ERROR to the client,
14828  the client can call this function to know the error cause.
14829  The error status will be updated on every operation and should be read
14830  frequently (ideally immediately after the service operation has completed)
14831  to know the relevant error status.
14832  Precondition:
14833  The SYS_DMA_Initialize routine must have been called for the DMA sub system.
14834  SYS_DMA_ChannelAllocate must have been called to obtain a valid opened channel
14835  handle.
14836  Parameters:
14837  handle - Handle of the DMA channel as returned by the
14838  SYS_DMA_ChannelAllocate function.
14839  Returns:
14840  A SYS_DMA_ERROR type indicating last known error status.
14841  Example:
14842  <code>
14843  // 'handle' is a valid handle returned
14844  // by the SYS_DMA_ChannelAllocate function.
14845  // pDmaSrc, pDmaDst is the source,destination address
14846  // txferSrcSize, txferDesSize is the source,destination transfer size
14847  // cellSize is the cell size
14848  MY_APP_OBJ myAppObj;
14849  // Client registers an event handler with service. This is done once
14850  SYS_DMA_ChannelTransferEventHandlerSet( handle, APP_DMATransferEventHandle,
14851  (uintptr_t)&myAppObj );
14852  SYS_DMA_ChannelSetup(handle, SYS_DMA_CHANNEL_OP_MODE_BASIC,
14853  DMA_TRIGGER_SOURCE_NONE);
14854  SYS_DMA_ChannelTransferAdd(handle,pDmaSrc,txferSrcSize,
14855  pDmaDst,txferDesSize,cellSize);
14856  SYS_DMA_ChannelForceStart(handle);
14857  if(SYS_DMA_CHANNEL_HANDLE_INVALID == handle)
14858  {
14859  // Error handling here
14860  }
14861  // Event Processing Technique. Event is received when
14862  // the transfer is processed.
14863  void APP_DMATransferEventHandle( SYS_DMA_TRANSFER_EVENT event,
14864  SYS_DMA_CHANNEL_HANDLE handle, uintptr_t contextHandle )
14865  {
14866  switch(event)
14867  {
14868  case SYS_DMA_TRANSFER_EVENT_COMPLETE:
14869  // This means the data was transferred.
14870  break;
14871  case SYS_DMA_TRANSFER_EVENT_ERROR:
14872  // Error handling here.
14873  if(SYS_DMA_ERROR_ADDRESS_ERROR == SYS_DMA_ChannelErrorGet(handle))
14874  {
14875  // There was an address error.
14876  // Do error handling here.
14877  }
14878  break;
14879  default:
14880  break;
14881  }
14882  }
14883  </code>
14884  Remarks:
14885  It is the client's responsibility to make sure that the error status is
14886  obtained frequently. The service will update the error status
14887  regardless of whether this has been examined by the client.
14888 */
14889 
14892  SYS_DMA_CHANNEL_HANDLE handle ) ;
14893 //******************************************************************************
14894 /* Function:
14895  void SYS_DMA_ChannelForceStart(SYS_DMA_CHANNEL_HANDLE handle)
14896  Summary:
14897  Force start of transfer on the selected channel.
14898  Description:
14899  The function force start a DMA transfer to occur for the selected channel.
14900  Precondition:
14901  DMA should have been initialized by calling SYS_DMA_Initialize.
14902  DMA channel should have been allocated by calling SYS_DMA_ChannelAllocate.
14903  The function SYS_DMA_ChannelSetup must have been called to setup and
14904  enable the required features.
14905  The function 'SYS_DMA_ChannelTransferAdd' to add a transfer.
14906  Parameters:
14907  handle - Handle of the DMA channel as returned by the
14908  SYS_DMA_ChannelAllocate function.
14909  Returns:
14910  None.
14911  Example:
14912  <code>
14913  // 'handle' is a valid handle returned
14914  // by the SYS_DMA_ChannelAllocate function.
14915  // pDmaSrc, pDmaDst is the source,destination address
14916  // txferSrcSize, txferDesSize is the source,destination transfer size
14917  // cellSize is the cell size
14918  MY_APP_OBJ myAppObj;
14919  // Client registers an event handler with service. This is done once
14920  SYS_DMA_ChannelTransferEventHandlerSet( handle, APP_DMATransferEventHandle,
14921  (uintptr_t)&myAppObj );
14922  SYS_DMA_ChannelSetup(handle, SYS_DMA_CHANNEL_OP_MODE_BASIC,
14923  DMA_TRIGGER_SOURCE_NONE);
14924  SYS_DMA_ChannelTransferAdd(handle,pDmaSrc,txferSrcSize,
14925  pDmaDst,txferDesSize,cellSize);
14926  SYS_DMA_ChannelForceStart(handle);
14927  if(SYS_DMA_CHANNEL_HANDLE_INVALID == handle)
14928  {
14929  // Error handling here
14930  }
14931  // Event Processing Technique. Event is received when
14932  // the transfer is processed.
14933  void APP_DMATransferEventHandle( SYS_DMA_TRANSFER_EVENT event,
14934  SYS_DMA_CHANNEL_HANDLE handle, uintptr_t contextHandle )
14935  {
14936  switch(event)
14937  {
14938  case SYS_DMA_TRANSFER_EVENT_COMPLETE:
14939  // This means the data was transferred.
14940  break;
14941  case SYS_DMA_TRANSFER_EVENT_ERROR:
14942  // Error handling here.
14943  if(SYS_DMA_ERROR_ADDRESS_ERROR == DRV_I2S_ErrorGet(myI2SHandle))
14944  {
14945  // There was an address error.
14946  // Do error handling here.
14947  }
14948  break;
14949  default:
14950  break;
14951  }
14952  }
14953  </code>
14954  Remarks:
14955  This function must be used to start the DMA transfer when the channel has been
14956  setup(by calling SYS_DMA_ChannelSetup) with the eventSrc as DMA_TRIGGER_SOURCE_NONE.
14957 */
14958 
14959 void
14961  SYS_DMA_CHANNEL_HANDLE handle ) ;
14962 //******************************************************************************
14963 /* Function:
14964  void SYS_DMA_ChannelForceAbort(SYS_DMA_CHANNEL_HANDLE handle)
14965  Summary:
14966  Force abort of transfer on the selected channel.
14967  Description:
14968  The function aborts a DMA transfer to occur for the selected channel.
14969  Precondition:
14970  DMA should have been initialized by calling SYS_DMA_Initialize.
14971  DMA channel should have been allocated by calling SYS_DMA_ChannelAllocate.
14972  The function SYS_DMA_ChannelSetup must have been called to setup and
14973  enable the required features.
14974  The function 'SYS_DMA_ChannelTransferAdd' to add a transfer.
14975  Parameters:
14976  handle - Handle of the DMA channel as returned by the
14977  SYS_DMA_ChannelAllocate function.
14978  Returns:
14979  None.
14980  Example:
14981  <code>
14982  // 'handle' is a valid handle returned
14983  // by the SYS_DMA_ChannelAllocate function.
14984  // pDmaSrc, pDmaDst is the source,destination address
14985  // txferSrcSize, txferDesSize is the source,destination transfer size
14986  // cellSize is the cell size
14987  MY_APP_OBJ myAppObj;
14988  // Client registers an event handler with service. This is done once
14989  SYS_DMA_ChannelTransferEventHandlerSet( handle, APP_DMATransferEventHandle,
14990  (uintptr_t)&myAppObj );
14991  SYS_DMA_ChannelSetup(handle, SYS_DMA_CHANNEL_OP_MODE_BASIC,
14992  DMA_TRIGGER_SOURCE_NONE);
14993  SYS_DMA_ChannelTransferAdd(handle,pDmaSrc,txferSrcSize,
14994  pDmaDst,txferDesSize,cellSize);
14995  SYS_DMA_ChannelForceStart(handle);
14996  if(SYS_DMA_CHANNEL_HANDLE_INVALID == handle)
14997  {
14998  // Error handling here
14999  }
15000  ....
15001  ....
15002  // Client may need to abort a transfer
15003  SYS_DMA_ChannelForceAbort(handle);
15004  // Event Processing Technique. Event is received when
15005  // the transfer is processed.
15006  void APP_DMATransferEventHandle( SYS_DMA_TRANSFER_EVENT event,
15007  SYS_DMA_CHANNEL_HANDLE handle, uintptr_t contextHandle )
15008  {
15009  switch(event)
15010  {
15011  case SYS_DMA_TRANSFER_EVENT_ABORT:
15012  // This means the data was transferred.
15013  break;
15014  case SYS_DMA_TRANSFER_EVENT_ERROR:
15015  // Error handling here.
15016  if(SYS_DMA_ERROR_ADDRESS_ERROR == DRV_I2S_ErrorGet(myI2SHandle))
15017  {
15018  // There was an address error.
15019  // Do error handling here.
15020  }
15021  break;
15022  default:
15023  break;
15024  }
15025  }
15026  </code>
15027  Remarks:
15028  This function must be used to abort the DMA transfer when the channel has been
15029  setup(by calling SYS_DMA_ChannelSetup) with the eventSrc as DMA_TRIGGER_SOURCE_NONE.
15030  and SYS_DMA_ChannelAbortEventSet has not been called.
15031 */
15032 
15033 void
15035  SYS_DMA_CHANNEL_HANDLE handle ) ;
15036 //******************************************************************************
15037 /* Function:
15038  void SYS_DMA_ChannelAbortEventSet
15039  (
15040  SYS_DMA_CHANNEL_HANDLE handle,
15041  DMA_TRIGGER_SOURCE eventSrc
15042  )
15043  Summary:
15044  Sets an event source and enables cell transfer abort event for the same
15045  for the selected channel.
15046  Description:
15047  This functions enables a cell transfer abort event for the selected source
15048  event.
15049  Precondition:
15050  DMA should have been initialized by calling SYS_DMA_Initialize.
15051  DMA channel should have been allocated by calling SYS_DMA_ChannelAllocate.
15052  The function SYS_DMA_ChannelSetup must have been called to setup and
15053  enable the required features.
15054  The function 'SYS_DMA_ChannelTransferAdd' to add a transfer.
15055  Parameters:
15056  handle - Handle of the DMA channel as returned by the
15057  SYS_DMA_ChannelAllocate function.
15058  eventSrc - The event causing the cell transfer abort
15059  Returns:
15060  None.
15061  Example:
15062  <code>
15063  // 'handle' is a valid handle returned
15064  // by the SYS_DMA_ChannelAllocate function.
15065  // pDmaSrc, pDmaDst is the source,destination address
15066  // txferSrcSize, txferDesSize is the source,destination transfer size
15067  // cellSize is the cell size
15068  MY_APP_OBJ myAppObj;
15069  // Client registers an event handler with service. This is done once
15070  SYS_DMA_ChannelTransferEventHandlerSet( handle, APP_DMATransferEventHandle,
15071  (uintptr_t)&myAppObj );
15072  SYS_DMA_ChannelSetup(handle, SYS_DMA_CHANNEL_OP_MODE_BASIC,
15073  DMA_TRIGGER_SOURCE_NONE);
15074  SYS_DMA_ChannelTransferAdd(handle,pDmaSrc,txferSrcSize,
15075  pDmaDst,txferDesSize,cellSize);
15076  SYS_DMA_ChannelAbortEventSet(handle, DMA_TRIGGER_CTMU);
15077  SYS_DMA_ChannelForceStart(handle);
15078  if(SYS_DMA_CHANNEL_HANDLE_INVALID == handle)
15079  {
15080  // Error handling here
15081  }
15082  // Event Processing Technique. Event is received when
15083  // the transfer is processed.
15084  void APP_DMATransferEventHandle( SYS_DMA_TRANSFER_EVENT event,
15085  SYS_DMA_CHANNEL_HANDLE handle, uintptr_t contextHandle )
15086  {
15087  switch(event)
15088  {
15089  case SYS_DMA_TRANSFER_EVENT_ABORT:
15090  // This means the data was transferred.
15091  break;
15092  case SYS_DMA_TRANSFER_EVENT_ERROR:
15093  // Error handling here.
15094  if(SYS_DMA_ERROR_ADDRESS_ERROR == DRV_I2S_ErrorGet(myI2SHandle))
15095  {
15096  // There was an address error.
15097  // Do error handling here.
15098  }
15099  break;
15100  default:
15101  break;
15102  }
15103  }
15104  </code>
15105  Remarks:
15106  If the parameter 'eventSrc' is specified as DMA_TRIGGER_SOURCE_NONE the
15107  current DMA transfer will be aborted. The behavior is a same as calling
15108  SYS_DMA_ChannelForceAbort.
15109 */
15110 
15111 void
15113  SYS_DMA_CHANNEL_HANDLE handle ,
15114  DMA_TRIGGER_SOURCE eventSrc ) ;
15115 //******************************************************************************
15116 /* Function:
15117  bool SYS_DMA_ChannelIsBusy(SYS_DMA_CHANNEL_HANDLE handle)
15118  Summary:
15119  Returns the busy status of the specified DMA channel.
15120  Description:
15121  This function returns the busy status of the selected DMA channel
15122  Precondition:
15123  DMA should have been initialized by calling SYS_DMA_Initialize.
15124  DMA channel should have been allocated by calling SYS_DMA_ChannelAllocate.
15125  Parameters:
15126  handle - Handle of the DMA channel as returned by the
15127  SYS_DMA_ChannelAllocate function.
15128  Returns:
15129  bool - true, if the selected DMA channel is active or enabled
15130  - false, if the selected DMA channel is inactive or disabled
15131  Example:
15132  <code>
15133  bool busyStat;
15134  busyStat = SYS_DMA_ChannelGetBusy(handle);
15135  </code>
15136  Remarks:
15137  This feature may not be available on all devices. Refer to the specific device
15138  data sheet to determine availability.
15139 */
15140 
15141 bool
15143  SYS_DMA_CHANNEL_HANDLE handle ) ;
15144 //******************************************************************************
15145 /* Function:
15146  void SYS_DMA_ChannelSuspend(SYS_DMA_CHANNEL_HANDLE handle)
15147  Summary:
15148  Suspend DMA operation on the specified DMA channel.
15149  Description:
15150  This function suspends the DMA operation on the DMA channel
15151  specified by the channel handle.
15152  Precondition:
15153  DMA should have been initialized by calling SYS_DMA_Initialize.
15154  DMA channel should have been allocated by calling SYS_DMA_ChannelAllocate.
15155  Parameters:
15156  handle - Handle of the DMA channel as returned by the
15157  SYS_DMA_ChannelAllocate function.
15158  Returns:
15159  None.
15160  Example:
15161  <code>
15162  SYS_DMA_ChannelSuspend(handle);
15163  </code>
15164  Remarks:
15165  This feature may not be available on all devices. Refer to the specific device
15166  data sheet to determine availability.
15167 */
15168 
15169 void
15171  SYS_DMA_CHANNEL_HANDLE handle ) ;
15172 //******************************************************************************
15173 /* Function:
15174  void SYS_DMA_ChannelResume(SYS_DMA_CHANNEL_HANDLE handle)
15175  Summary:
15176  Resume DMA operation on the specified DMA channel.
15177  Description:
15178  This function resumes the DMA operation on the DMA channel
15179  specified by the channel handle.
15180  Precondition:
15181  DMA should have been initialized by calling SYS_DMA_Initialize.
15182  DMA channel should have been allocated by calling SYS_DMA_ChannelAllocate.
15183  Parameters:
15184  handle - Handle of the DMA channel as returned by the
15185  SYS_DMA_ChannelAllocate function.
15186  Returns:
15187  None.
15188  Example:
15189  <code>
15190  SYS_DMA_ChannelResume(handle);
15191  </code>
15192  Remarks:
15193  This feature may not be available on all devices. Refer to the specific device
15194  data sheet to determine availability.
15195 */
15196 
15197 void
15199  SYS_DMA_CHANNEL_HANDLE handle ) ;
15200 // *****************************************************************************
15201 // *****************************************************************************
15202 // Section: Global DMA Management Functions
15203 // *****************************************************************************
15204 // *****************************************************************************
15205 //******************************************************************************
15206 /* Function:
15207  void SYS_DMA_Suspend(void)
15208  Summary:
15209  Suspend DMA transfers.
15210  Description:
15211  This function suspends DMA transfers to allow CPU uninterrupted access
15212  to data bus
15213  Precondition:
15214  DMA should have been initialized by calling SYS_DMA_Initialize.
15215  Parameters:
15216  None.
15217  Returns:
15218  None.
15219  Example:
15220  <code>
15221  SYS_DMA_Suspend();
15222  </code>
15223  Remarks:
15224  None
15225 */
15226 
15227 void
15228  SYS_DMA_Suspend ( void ) ;
15229 //******************************************************************************
15230 /* Function:
15231  void SYS_DMA_Resume(void)
15232  Summary:
15233  Resume DMA operations.
15234  Description:
15235  This function disables DMA suspend. It resumes the DMA operation suspended
15236  by calling SYS_DMA_Suspend. The DMA operates normally.
15237  Precondition:
15238  DMA should have been initialized by calling SYS_DMA_Initialize.
15239  Parameters:
15240  None.
15241  Returns:
15242  None.
15243  Example:
15244  <code>
15245  SYS_DMA_Resume();
15246  </code>
15247  Remarks:
15248  None
15249 */
15250 
15251 void
15252  SYS_DMA_Resume ( void ) ;
15253 //******************************************************************************
15254 /* Function:
15255  bool SYS_DMA_IsBusy(void)
15256  Summary:
15257  Returns the busy status of the DMA module.
15258  Description:
15259  This function returns the busy status of the DMA module
15260  Precondition:
15261  DMA should have been initialized by calling SYS_DMA_Initialize.
15262  Parameters:
15263  None.
15264  Returns:
15265  Boolean
15266  - true - The DMA module is active
15267  - false - The DMA module is inactive and disabled
15268  <code>
15269  bool busyStat;
15270  busyStat = SYS_DMA_IsBusy();
15271  </code>
15272  Remarks:
15273  This feature may not be available on all devices. Refer to the specific device
15274  data sheet to determine availability.
15275 */
15276 
15277 bool
15278  SYS_DMA_IsBusy ( void ) ;
15279 // *****************************************************************************
15280 // *****************************************************************************
15281 // Section: Deprecated functions
15282 // *****************************************************************************
15283 // *****************************************************************************
15284 //*******************************************************************************
15285 /* Function:
15286  void SYS_DMA_TasksISR(SYS_MODULE_OBJ object, DMA_CHANNEL activeChannel)
15287  Summary:
15288  This function is deprecated. Use SYS_DMA_Tasks function.
15289  */
15290 
15291 void
15292  SYS_DMA_Tasks (
15293  SYS_MODULE_OBJ object ,
15294  DMA_CHANNEL activeChannel ) ;
15295 //*****************************************************************************
15296 /* Function:
15297  void SYS_DMA_TasksError(SYS_MODULE_OBJ object)
15298  Summary:
15299  This function is deprecated. Use SYS_DMA_Tasks function.
15300  */
15301 
15302 void
15304  SYS_MODULE_OBJ object ) ;
15305 //*******************************************************************************
15306 /* Function:
15307  void SYS_DMA_TasksErrorISR(SYS_MODULE_OBJ object, DMA_CHANNEL activeChannel)
15308  Summary:
15309  This function is deprecated. Use SYS_DMA_Tasks function.
15310  */
15311 
15312 void
15314  SYS_MODULE_OBJ object ,
15315  DMA_CHANNEL activeChannel ) ;
15316  // #ifndef _SYS_DMA_H
15317 /*******************************************************************************
15318  End of File
15319 */
15320 
15321 #endif /*00 C:\microchip\harmony\v2_06\framework\system\dma\sys_dma.h*/
15322 /* CLOSE_FILE Include File */
15323 
15324 // DOM-IGNORE-BEGIN
15325 // DOM-IGNORE-END
15326 // *****************************************************************************
15327 // *****************************************************************************
15328 // Section: Data Types
15329 // *****************************************************************************
15330 // *****************************************************************************
15331 // *****************************************************************************
15332 /* Driver USART Module Index
15333  Summary:
15334  USART driver index definitions
15335  Description:
15336  These constants provide USART driver index definitions.
15337  Remarks:
15338  These constants should be used in place of hard-coded numeric literals.
15339  These values should be passed into the DRV_USART_Initialize and
15340  DRV_USART_Open routines to identify the driver instance in use.
15341 */
15342 #define DRV_USART_INDEX_0 0
15343 #define DRV_USART_INDEX_1 1
15344 #define DRV_USART_INDEX_2 2
15345 #define DRV_USART_INDEX_3 3
15346 #define DRV_USART_INDEX_4 4
15347 #define DRV_USART_INDEX_5 5
15348 // *****************************************************************************
15349 /* USART Driver Module Count
15350  Summary:
15351  Number of valid USART drivers
15352  Description:
15353  This constant identifies the maximum number of USART Driver instances that
15354  should be defined in the system. Defining more instances than this
15355  constant will waste RAM memory space.
15356  This constant can also be used by the system and application to identify the
15357  number of USART instances on this microcontroller.
15358  Remarks:
15359  This value is part-specific.
15360 */
15361 #define DRV_USART_COUNT USART_NUMBER_OF_MODULES
15362 // *****************************************************************************
15363 /* USART Driver Write Error
15364  Summary:
15365  USART Driver Write Error.
15366  Description:
15367  This constant is returned by DRV_USART_Write() function when an error
15368  occurs.
15369  Remarks:
15370  None.
15371 */
15372 #define DRV_USART_WRITE_ERROR ( ( uint32_t ) ( - 1 ) )
15373 // *****************************************************************************
15374 /* USART Driver Read Error
15375  Summary:
15376  USART Driver Read Error.
15377  Description:
15378  This constant is returned by DRV_USART_Read() function when an error
15379  occurs.
15380  Remarks:
15381  None.
15382 */
15383 #define DRV_USART_READ_ERROR ( ( uint32_t ) ( - 1 ) )
15384 // *****************************************************************************
15385 /* USART Driver Buffer Handle
15386  Summary:
15387  Handle identifying a read or write buffer passed to the driver.
15388  Description:
15389  A buffer handle value is returned by a call to the DRV_USART_BufferAddRead
15390  or DRV_USART_BufferAddWrite functions. This handle is associated with the
15391  buffer passed into the function and it allows the application to track the
15392  completion of the data from (or into) that buffer. The buffer handle value
15393  returned from the "buffer add" function is returned back to the client
15394  by the "event handler callback" function registered with the driver.
15395  The buffer handle assigned to a client request expires when the client has
15396  been notified of the completion of the buffer transfer (after event handler
15397  function that notifies the client returns) or after the buffer has been
15398  retired by the driver if no event handler callback was set.
15399  Remarks:
15400  None
15401 */
15402 
15403 typedef
15404 uintptr_t
15406 // *****************************************************************************
15407 /* USART Driver Invalid Buffer Handle
15408  Summary:
15409  Definition of an invalid buffer handle.
15410  Description:
15411  This is the definition of an invalid buffer handle. An invalid buffer handle
15412  is returned by DRV_USART_BufferAddRead and DRV_USART_BufferAddWrite
15413  functions if the buffer add request was not successful.
15414  Remarks:
15415  None
15416 */
15417 #define DRV_USART_BUFFER_HANDLE_INVALID ( ( DRV_USART_BUFFER_HANDLE ) ( - 1 ) )
15418 // *****************************************************************************
15419 /* USART Modes of Operation
15420  Summary:
15421  Identifies the modes of the operation of the USART module
15422  Description:
15423  This data type identifies the modes of the operation of the USART module.
15424  Remarks:
15425  Not all modes are available on all devices. Refer to the specific device data
15426  sheet to determine availability.
15427 */
15428 
15429 typedef
15430  enum
15431  {
15432  /* USART works in IRDA mode */
15434  /* This is the normal point to point communication mode where the USART
15435  communicates directly with another USART by connecting it's Transmit signal
15436  to the external USART's Receiver signal and vice versa. An external
15437  transceiver may be connected to obtain RS-232 signal levels. This type of
15438  connection is typically full duplex. */
15440  /* This is a multi-point bus mode where the USART can communicate with
15441  many other USARTS on a bus using an address-based protocol such as RS-485.
15442  This mode is typically half duplex and the physical layer may require a
15443  transceiver. In this mode every USART on the bus is assigned an address and
15444  the number of data bits is 9 bits */
15446  /* Loopback mode internally connects the Transmit signal to the Receiver
15447  signal, looping data transmission back into this USART's own input. It is
15448  useful primarily as a test mode. */
15451 // *****************************************************************************
15452 /* USART Driver Buffer Events
15453  Summary
15454  Identifies the possible events that can result from a buffer add request.
15455  Description
15456  This enumeration identifies the possible events that can result from a
15457  buffer add request caused by the client calling either the
15458  DRV_USART_BufferAddRead or DRV_USART_BufferAddWrite functions.
15459  Remarks:
15460  One of these values is passed in the "event" parameter of the event
15461  handling callback function that the client registered with the driver by
15462  calling the DRV_USART_BufferEventHandlerSet function when a buffer
15463  transfer request is completed.
15464 */
15465 
15466 typedef
15467  enum
15468  {
15469  /* All data from or to the buffer was transferred successfully. */
15471  /* There was an error while processing the buffer transfer request. */
15473  /* Data transfer aborted (Applicable in DMA mode) */
15476 // *****************************************************************************
15477 /* USART Driver Buffer Result
15478  Summary
15479  Identifies the possible result of the buffer processing.
15480  Description
15481  This enumeration identifies the possible result of the buffer processing.
15482 
15483  Remarks:
15484  DRV_USART_BUFFER_RESULT_HANDLE_EXPIRED is the state of the buffer which
15485  is in the free buffer pool.
15486 */
15487 
15488 typedef
15489  enum
15490  {
15491  /* Buffer handle is not valid*/
15493  /* Buffer handle has expired. */
15495  /* Buffer is removed from the queue succesfully*/
15497  /* Buffer removal failed because of unable to acquire the mutex
15498  * This is applicable in RTOS mode only */
15501 // *****************************************************************************
15502 /* USART Driver Buffer Event Handler Function Pointer
15503  Summary
15504  Pointer to a USART Driver Buffer Event handler function
15505  Description
15506  This data type defines the required function signature for the USART driver
15507  buffer event handling callback function. A client must register a pointer
15508  to a buffer event handling function whose function signature (parameter
15509  and return value types) match the types specified by this function pointer
15510  in order to receive buffer related event calls back from the driver.
15511  The parameters and return values and are described here and
15512  a partial example implementation is provided.
15513  Parameters:
15514  event - Identifies the type of event
15515  bufferHandle - Handle identifying the buffer to which the vent relates
15516  context - Value identifying the context of the application that registered
15517  the event handling function.
15518  Returns:
15519  None.
15520  Example:
15521  <code>
15522  void APP_MyBufferEventHandler( DRV_USART_BUFFER_EVENT event,
15523  DRV_USART_BUFFER_HANDLE bufferHandle,
15524  uintptr_t context )
15525  {
15526  MY_APP_DATA_STRUCT pAppData = (MY_APP_DATA_STRUCT) context;
15527  switch(event)
15528  {
15529  case DRV_USART_BUFFER_EVENT_COMPLETE:
15530  // Handle the completed buffer.
15531  break;
15532  case DRV_USART_BUFFER_EVENT_ERROR:
15533  default:
15534  // Handle error.
15535  break;
15536  }
15537  }
15538  </code>
15539  Remarks:
15540  If the event is DRV_USART_BUFFER_EVENT_COMPLETE, it means that the data was
15541  transferred successfully.
15542  If the event is DRV_USART_BUFFER_EVENT_ERROR, it means that the data was not
15543  transferred successfully. The DRV_USART_ErrorGet function can be called to
15544  know the error. The DRV_USART_BufferCompletedBytesGet function can be
15545  called to find out how many bytes were processed.
15546  The bufferHandle parameter contains the buffer handle of the buffer that
15547  associated with the event.
15548  The context parameter contains the a handle to the client context,
15549  provided at the time the event handling function was registered using the
15550  DRV_USART_BufferEventHandlerSet function. This context handle value is
15551  passed back to the client as the "context" parameter. It can be any value
15552  necessary to identify the client context or instance (such as a pointer to
15553  the client's data) instance of the client that made the buffer add request.
15554  The event handler function executes in the driver peripheral's interrupt
15555  context when the driver is configured for interrupt mode operation. It is
15556  recommended of the application to not perform process intensive or blocking
15557  operations with in this function.
15558  The DRV_USART_BufferAddRead and DRV_USART_BufferAddWrite functions can
15559  be called in the event handler to add a buffer to the driver queue. These
15560  functions can only be called to add buffers to the driver whose event
15561  handler is running. For example, buffers cannot be added USART2 driver in
15562  USART1 driver event handler.
15563 */
15564 
15565 typedef
15567 DRV_USART_BUFFER_HANDLE bufferHandle ,
15568 uintptr_t context ) ;
15569 // *****************************************************************************
15570 /* USART Driver Byte Event Handler Function Pointer
15571  Summary
15572  Pointer to a USART Driver Byte Event handler function
15573  Description
15574  This data type defines the required function signature for the USART driver
15575  byte event handling callback function. A client must register a pointer to a
15576  byte event handling function whose function signature (parameter and return
15577  value types) match the types specified by this function pointer in order to
15578  receive byte related event calls back from the driver.
15579  Parameters:
15580  index - Identifier for the instance
15581  Returns:
15582  None.
15583  Example:
15584  <code>
15585  void APP_MyUsartTxEventHandler(void)
15586  {
15587  // Handle the transmit byte event
15588  }
15589  </code>
15590  Remarks:
15591  The event handler function executes in the driver peripheral's interrupt
15592  context when the driver is configured for interrupt mode operation. It is
15593  recommended that the application not perform process intensive or blocking
15594  operations with in this function.
15595 */
15596 
15597 typedef
15598 void ( * DRV_USART_BYTE_EVENT_HANDLER ) ( const SYS_MODULE_INDEX index ) ;
15599 // *****************************************************************************
15600 /* USART Handshake Modes
15601  Summary:
15602  Identifies the handshaking modes supported by the USART driver.
15603  Description:
15604  This data type identifies the handshaking modes supported by the USART
15605  driver.
15606  Remarks:
15607  Not all modes are available on all devices. Refer to the specific device data
15608  sheet to determine availability.
15609 */
15610 
15611 typedef
15612  enum
15613  {
15614  /* Handshaking occurs in Flow Control Mode */
15615  DRV_USART_HANDSHAKE_FLOWCONTROL = /*DOM-IGNORE-BEGIN*/
15616  USART_HANDSHAKE_MODE_FLOW_CONTROL /*DOM-IGNORE-END*/
15617  ,
15618  /* Handshaking occurs in Simplex Mode */
15619  DRV_USART_HANDSHAKE_SIMPLEX = /*DOM-IGNORE-BEGIN*/
15620  USART_HANDSHAKE_MODE_SIMPLEX /*DOM-IGNORE-END*/
15621  ,
15622  /* No Handshaking */
15623  DRV_USART_HANDSHAKE_NONE = /*DOM-IGNORE-BEGIN*/
15624  2 /*DOM-IGNORE-END*/
15626 // *****************************************************************************
15627 /* USART Baud Set Result
15628  Summary:
15629  Identifies the results of the baud set function.
15630  Description:
15631  This data type identifies the results of the DRV_USART_BaudSet function.
15632  Remarks:
15633  None.
15634 */
15635 
15636 typedef
15637  enum
15638  {
15639  /* The driver was not able to change the baud */
15640  DRV_USART_BAUD_SET_ERROR = /*DOM-IGNORE-BEGIN*/
15641  - 1 /*DOM-IGNORE-END*/
15642  ,
15643  /* The driver was able to change the baud successfully */
15646 // *****************************************************************************
15647 /* USART Line Control Set Result
15648  Summary:
15649  Identifies the results of the baud set function.
15650  Description:
15651  This data type identifies the results of the DRV_USART_LineControlSet
15652  function.
15653  Remarks:
15654  None.
15655 */
15656 
15657 typedef
15658  enum
15659  {
15660  /* The driver was not able to change the Line Control */
15661  DRV_USART_LINE_CONTROL_SET_ERROR = /*DOM-IGNORE-BEGIN*/
15662  - 1 /*DOM-IGNORE-END*/
15663  ,
15664  /* The driver was able to change the Line Control successfully */
15667 // *****************************************************************************
15668 /* USART Line Control Modes
15669  Summary:
15670  Identifies the line control modes supported by the USART driver.
15671  Description:
15672  This data type identifies the line control modes supported by the USART
15673  driver. Line control modes define the number of data bits, parity mode, and
15674  the number of stop bits in a USART transmit and receive frames.
15675  Remarks:
15676  The abbreviations used in the labels for the values of this enumeration
15677  follow the format <data><parity><stop>, where:
15678  <data> is the number of data bits
15679  <parity> is either "NONE" (for no parity), "EVEN" for 1 parity bit
15680  added to obtain an even number of bits, or "ODD" for one bit
15681  added to obtain an odd number of bits.
15682  <stop> is the number of Stop bits
15683 */
15684 
15685 typedef
15686  enum
15687  {
15688  /* 8 data bits, no parity bit, 1 stop bit */
15689  DRV_USART_LINE_CONTROL_8NONE1 = /*DOM-IGNORE-BEGIN*/
15690  USART_8N1 /* DOM-IGNORE-END*/
15691  ,
15692  /* 9 data bits, no parity bit, 1 stop bit */
15693  DRV_USART_LINE_CONTROL_9NONE1 = /*DOM-IGNORE-BEGIN*/
15694  USART_9N1 /* DOM-IGNORE-END*/
15695  ,
15696  /* 8 data bits, 1 bit for even parity, 1 stop bit */
15697  DRV_USART_LINE_CONTROL_8EVEN1 = /*DOM-IGNORE-BEGIN*/
15698  USART_8E1 /* DOM-IGNORE-END*/
15699  ,
15700  /* 8 data bits, 1 bit for even parity, 2 stop bits */
15701  DRV_USART_LINE_CONTROL_8EVEN2 = /*DOM-IGNORE-BEGIN*/
15702  USART_8E2 /* DOM-IGNORE-END*/
15703  ,
15704  /* 8 data bits, 1 bit for odd parity, 1 stop bit */
15705  DRV_USART_LINE_CONTROL_8ODD1 = /*DOM-IGNORE-BEGIN*/
15706  USART_8O1 /* DOM-IGNORE-END*/
15707  ,
15708  /* 8 data bits, 1 bit for odd parity, 2 stop bits */
15709  DRV_USART_LINE_CONTROL_8ODD2 = /*DOM-IGNORE-BEGIN*/
15710  USART_8O2 /* DOM-IGNORE-END*/
15711  ,
15712  /* 8 data bits, no parity bit, 2 stop bit */
15713  DRV_USART_LINE_CONTROL_8NONE2 = /*DOM-IGNORE-BEGIN*/
15714  USART_8N2 /* DOM-IGNORE-END*/
15715  ,
15716  /* 9 data bits, no parity bit, 2 stop bit */
15717  DRV_USART_LINE_CONTROL_9NONE2 = /*DOM-IGNORE-BEGIN*/
15718  USART_9N2 /* DOM-IGNORE-END*/
15720 // *****************************************************************************
15721 /* USART Initialization flags
15722  Summary:
15723  Flags identifying features that can be enabled when the driver is
15724  initialized.
15725  Description:
15726  This enumeration defines flags identifying features that can be enabled
15727  when the driver is initialized.
15728  Remarks:
15729  These flags can be logically ORed together. They are passed into the
15730  DRV_USART_Initialize function through the "flags" member of the
15731  DRV_USART_INIT structure.
15732 */
15733 
15734 typedef
15735  enum
15736  {
15737  /* Use this if no flags need to be set */
15738  DRV_USART_INIT_FLAG_NONE = /* DOM-IGNORE-BEGIN */
15739  0 /*DOM-IGNORE-END*/
15740  ,
15741  /* Flag to enable "wake on start" operation. If supported and enabled,
15742  this feature will allow the USART to wake-up the device when a
15743  Start bit is received. This option should be selected only when the
15744  device is to placed in Sleep mode. Note that enabling this bit will
15745  also cause the first received character to be lost. Refer to the specific
15746  device data sheet for more information. */
15748  = ( 1 << 0 ) /*DOM-IGNORE-END*/
15749  ,
15750  /* Flag to enable auto baud detection. If supported and enabled, this
15751  feature will allow the USART to automatically detect the baud rate in
15752  use. */
15753  DRV_USART_INIT_FLAG_AUTO_BAUD/*DOM-IGNORE-BEGIN*/
15754  = ( 1 << 1 ) /*DOM-IGNORE-END*/
15755  ,
15756  /* Flag to enable stop in idle. If supported and enabled , this
15757  feature will allow the USART to stop when the CPU enters Idle
15758  mode */
15760  = ( 1 << 2 ) /*DOM-IGNORE-END*/
15762 // *****************************************************************************
15763 /* Operation Mode Initialization Data
15764  Summary:
15765  Defines the initialization data required for different operation modes of
15766  USART.
15767  Description:
15768  This data type defines the initialization data required for different
15769  operation modes of the USART.
15770  Remarks:
15771  None
15772 */
15773 
15774 typedef
15775  union
15776  {
15777  /* Initialization for Addressed mode */
15778  struct
15779  {
15780  /* Address of the device. */
15781  uint8_t address ;
15782  } AddressedModeInit ;
15784 // *****************************************************************************
15785 /* USART Driver Errors.
15786  Summary:
15787  Defines the possible errors that can occur during driver operation.
15788  Description:
15789  This data type defines the possible errors that can occur when occur during
15790  USART driver operation. These values are returned by DRV_USART_ErrorGet
15791  function.
15792  Remarks:
15793  None
15794 */
15795 
15796 typedef
15797  enum
15798  {
15799  /* There was no error */
15801  /*DOM-IGNORE-BEGIN*/
15802  = USART_ERROR_NONE /*DOM-IGNORE-END*/
15803  ,
15804  /* This indicates that a parity error has occurred */
15806  /*DOM-IGNORE-BEGIN*/
15807  = USART_ERROR_PARITY /*DOM-IGNORE-END*/
15808  ,
15809  /* This indicates that a framing error has occurred */
15811  /*DOM-IGNORE-BEGIN*/
15812  = USART_ERROR_FRAMING /*DOM-IGNORE-END*/
15813  ,
15814  /* This indicates a receiver overflow has occurred */
15816  /*DOM-IGNORE-BEGIN*/
15817  = USART_ERROR_RECEIVER_OVERRUN /*DOM-IGNORE-END*/
15818  ,
15819  /* Channel address error (Applicable in DMA mode) */
15820  DRV_USART_ERROR_ADDRESS /*DOM-IGNORE-BEGIN*/
15821  = ( 1 << 4 ) /* DOM-IGNORE-END*/
15822  } DRV_USART_ERROR ;
15823 // *****************************************************************************
15824 /* USART Client-Specific Driver Status
15825  Summary:
15826  Defines the client-specific status of the USART driver.
15827  Description:
15828  This enumeration defines the client-specific status codes of the USART
15829  driver.
15830  Remarks:
15831  Returned by the DRV_USART_ClientStatus function.
15832 */
15833 
15834 typedef
15835  enum
15836  {
15837  /* An error has occurred.*/
15839  /* The driver is closed, no operations for this client are ongoing,
15840  and/or the given handle is invalid. */
15842  /* The driver is currently busy and cannot start additional operations. */
15844  /* The module is running and ready for additional operations */
15847 // *****************************************************************************
15848 /* USART Driver Transfer Flags
15849  Summary
15850  Specifies the status of the receive or transmit
15851  Description
15852  This type specifies the status of the receive or transmit operation.
15853  Remarks:
15854  More than one of these values may be OR'd together to create a complete
15855  status value. To test a value of this type, the bit of interest must be
15856  ANDed with the value and checked to see if the result is non-zero.
15857 */
15858 
15859 typedef
15860  enum
15861  {
15862  /* Indicates that at least one byte of Data has been received */
15864  /*DOM-IGNORE-BEGIN*/
15865  = ( 1 << 0 ) /*DOM-IGNORE-END*/
15866  ,
15867  /* Indicates that the core driver receiver buffer is empty */
15869  /*DOM-IGNORE-BEGIN*/
15870  = ( 1 << 1 ) /*DOM-IGNORE-END*/
15871  ,
15872  /* Indicates that the core driver transmitter buffer is full */
15874  /*DOM-IGNORE-BEGIN*/
15875  = ( 1 << 2 ) /*DOM-IGNORE-END*/
15876  ,
15877  /* Indicates that the core driver transmitter buffer is empty */
15879  /*DOM-IGNORE-BEGIN*/
15880  = ( 1 << 3 ) /*DOM-IGNORE-END*/
15882 // *****************************************************************************
15883 /* USART Driver Initialization Data
15884  Summary:
15885  Defines the data required to initialize or reinitialize the USART driver
15886  Description:
15887  This data type defines the data required to initialize or reinitialize the
15888  USART driver. If the driver is built statically, the members of this data
15889  structure are statically over-ridden by static override definitions in the
15890  system_config.h file.
15891  Remarks:
15892  None.
15893 */
15894 
15895 typedef
15896  struct
15897  {
15898  /* System module initialization data */
15899  SYS_MODULE_INIT moduleInit ;
15900  /* Identifies USART hardware module (PLIB-level) ID. For a static build of
15901  the driver, this is overridden by DRV_USART_MODULE_ID macro in the
15902  system_config.h header file. */
15903  USART_MODULE_ID usartID ;
15904  /* Identifies the Operation mode of the USART driver. For a static build of
15905  the driver, this is overridden by DRV_USART_MODE_SELECT macro in the
15906  system_config.h header file. */
15908  /* Data required by the operation mode of the driver. For a static build of
15909  the driver, this is overridden by DRV_USART_MODE_DATA macro in the
15910  system_config.h header file. */
15912  /* Flags to enable specific features. Refer to the
15913  description of DRV_USART_INIT_FLAGS for more details. For a static build
15914  of the driver, this is overridden by DRV_USART_FLAGS macro in the
15915  system_config.h header file. */
15916  DRV_USART_INIT_FLAGS flags ;
15917  /* USART module Baud Rate Generator Clock. This typically
15918  the peripheral bus clock frequency. For a static build of the driver,
15919  this is overridden by DRV_USART_BRG_CLOCK macro in the system_config.h
15920  header file. */
15921  uint32_t brgClock ;
15922  /* The initial USART line control settings. For a static build of the driver
15923  this is overridden by the DRV_USART_LINE_CONTROL_SET macro in the
15924  system_config.h header file. */
15925  DRV_USART_LINE_CONTROL lineControl ;
15926  /* Baud Rate value to be used, if not using auto baud. For a static build of
15927  the driver, this is overridden by the DRV_USART_BAUD macro in the
15928  system_config.h header file. */
15929  uint32_t baud ;
15930  /* Handshaking mode. For a static build of the driver, this is overridden by
15931  the DRV_USART_HANDSHAKE_SET macro in the system_config.h header file. */
15932  DRV_USART_HANDSHAKE handshake ;
15933  /* Lines enabled for the USART operation. For a static build of the driver,
15934  this is overridden by the DRV_USART_LINES_ENABLE macro in
15935  the system_config.h header file.
15936  For PPS parts, pin selection in ports overrides this. */
15937  USART_OPERATION_MODE linesEnable ;
15938  /* Interrupt source ID for the transmitter interrupt. For a static build of
15939  the driver, this is overridden by the DRV_USART_TRANSMIT_INTERRUPT_SOURCE
15940  macro in the system_config.h header. */
15941  INT_SOURCE interruptTransmit ;
15942  /* Interrupt source ID for the receiver interrupt. For a static build of
15943  the driver, this is overridden by the DRV_USART_RECEIVE_INTERRUPT_SOURCE
15944  macro in the system_config.h header. */
15945  INT_SOURCE interruptReceive ;
15946  /* Interrupt source ID for the error Interrupt. For a static build of the
15947  driver, this is overridden by the DRV_USART_ERROR_INTERRUPT_SOURCE macro
15948  in the system_config.h header. */
15949  INT_SOURCE interruptError ;
15950  /* This is the receive buffer queue size. This is the maximum
15951  number of read requests that driver will queue. For a
15952  static build of the driver, this is overridden by the
15953  DRV_USART_RECEIVE_QUEUE_SIZE macro in system_config.h */
15954  unsigned int queueSizeReceive ;
15955  /* This is the transmit buffer queue size. This is the maximum
15956  number of write requests that driver will queue. For a
15957  static build of the driver, this is overridden by the
15958  DRV_USART_TRANSMIT_QUEUE_SIZE macro in system_config.h */
15959  unsigned int queueSizeTransmit ;
15960  /* This is the USART transmit DMA channel.
15961  For a static build of the driver, this is overridden by the
15962  DRV_USART_XMIT_DMA_CH_IDXn macro in system_config.h */
15963  DMA_CHANNEL dmaChannelTransmit ;
15964  /* This is the USART receive DMA channel.
15965  For a static build of the driver, this is overridden by the
15966  DRV_USART_RCV_DMA_CH_IDXn macro in system_config.h */
15967  DMA_CHANNEL dmaChannelReceive ;
15968  /* This is the USART transmit DMA channel interrupt.
15969  For a static build of the driver, this is overridden by the
15970  DRV_USART_XMIT_DMA_INT_SRC_IDXn macro in system_config.h */
15971  INT_SOURCE dmaInterruptTransmit ;
15972  /* This is the USART receive DMA channel interrupt.
15973  For a static build of the driver, this is overridden by the
15974  DRV_USART_RCV_DMA_INT_SRC_IDXn macro in system_config.h */
15975  INT_SOURCE dmaInterruptReceive ;
15976  } DRV_USART_INIT ;
15977 //DOM-IGNORE-BEGIN
15978 //DOM-IGNORE-END
15979  // #ifndef _DRV_USART_DEFINITIONS_H
15980 /*******************************************************************************
15981  End of File
15982 */
15983 
15984 #endif /*00 C:\microchip\harmony\v2_06\framework\driver\usart\drv_usart_definitions.h*/
15985 /* CLOSE_FILE Include File */
15986 
15987 // DOM-IGNORE-BEGIN
15988 // DOM-IGNORE-END
15989 // *****************************************************************************
15990 // *****************************************************************************
15991 // Section: USART Driver Module Interface Routines
15992 // *****************************************************************************
15993 // *****************************************************************************
15994 // *****************************************************************************
15995 /* Function:
15996  SYS_MODULE_OBJ DRV_USART_Initialize
15997  (
15998  const SYS_MODULE_INDEX index,
15999  const SYS_MODULE_INIT * const init
16000  )
16001  Summary:
16002  Initializes the USART instance for the specified driver index.
16003  <p><b>Implementation:</b> Static/Dynamic</p>
16004  Description:
16005  This routine initializes the USART driver instance for the specified driver
16006  index, making it ready for clients to open and use it. The initialization
16007  data is specified by the init parameter. The initialization may fail if the
16008  number of driver objects allocated are insufficient or if the specified
16009  driver instance is already initialized. The driver instance index is
16010  independent of the USART module ID. For example, driver instance 0 can be
16011  assigned to USART2. If the driver is built statically, then some of the
16012  initialization parameters are overridden by configuration macros. Refer to
16013  the description of the DRV_USART_INIT data structure for more details on
16014  which members on this data structure are overridden.
16015  Precondition:
16016  None.
16017  Parameters:
16018  index - Identifier for the instance to be initialized
16019  init - Pointer to a data structure containing any data necessary to
16020  initialize the driver.
16021  Returns:
16022  If successful, returns a valid handle to a driver instance object.
16023  Otherwise, returns SYS_MODULE_OBJ_INVALID.
16024  Example:
16025  <code>
16026  // The following code snippet shows an example USART driver initialization.
16027  // The driver is initialized for normal mode and a baud of 300. The
16028  // receive queue size is set to 2 and transmit queue size is set to 3.
16029  DRV_USART_INIT usartInit;
16030  SYS_MODULE_OBJ objectHandle;
16031  usartInit.baud = 300;
16032  usartInit.mode = DRV_USART_OPERATION_MODE_NORMAL;
16033  usartInit.flags = DRV_USART_INIT_FLAG_NONE;
16034  usartInit.usartID = USART_ID_2;
16035  usartInit.brgClock = 80000000;
16036  usartInit.handshake = DRV_USART_HANDSHAKE_NONE;
16037  usartInit.lineControl = DRV_USART_LINE_CONTROL_8NONE1;
16038  usartInit.interruptError = INT_SOURCE_USART_2_ERROR;
16039  usartInit.interruptReceive = INT_SOURCE_USART_2_RECEIVE;
16040  usartInit.queueSizeReceive = 2;
16041  usartInit.queueSizeTransmit = 3;
16042  usartInit.interruptTransmit = INT_SOURCE_USART_2_TRANSMIT;
16043  usartInit.moduleInit.value = SYS_MODULE_POWER_RUN_FULL;
16044  objectHandle = DRV_USART_Initialize(DRV_USART_INDEX_1, (SYS_MODULE_INIT*)&usartInitData);
16045  if (SYS_MODULE_OBJ_INVALID == objectHandle)
16046  {
16047  // Handle error
16048  }
16049  </code>
16050  Remarks:
16051  This routine must be called before any other USART routine is called.
16052  This routine should only be called once during system initialization
16053  unless DRV_USART_Deinitialize is called to deinitialize the driver
16054  instance. This routine will NEVER block for hardware access.
16055 */
16056 
16057 SYS_MODULE_OBJ
16059  const SYS_MODULE_INDEX index ,
16060  const SYS_MODULE_INIT * const init ) ;
16061 // *****************************************************************************
16062 /* Function:
16063  void DRV_USART_Deinitialize( SYS_MODULE_OBJ object )
16064  Summary:
16065  Deinitializes the specified instance of the USART driver module.
16066  <p><b>Implementation:</b> Static/Dynamic</p>
16067  Description:
16068  Deinitializes the specified instance of the USART driver module, disabling
16069  its operation (and any hardware). Invalidates all the internal data.
16070  Precondition:
16071  Function DRV_USART_Initialize should have been called before calling this
16072  function.
16073  Parameters:
16074  object - Driver object handle, returned from the
16075  DRV_USART_Initialize routine
16076  Returns:
16077  None.
16078  Example:
16079  <code>
16080  SYS_MODULE_OBJ object; // Returned from DRV_USART_Initialize
16081  SYS_STATUS status;
16082  DRV_USART_Deinitialize(object);
16083  status = DRV_USART_Status(object);
16084  if (SYS_MODULE_DEINITIALIZED != status)
16085  {
16086  // Check again later if you need to know
16087  // when the driver is deinitialized.
16088  }
16089  </code>
16090  Remarks:
16091  Once the Initialize operation has been called, the Deinitialize operation
16092  must be called before the Initialize operation can be called again. This
16093  routine will NEVER block waiting for hardware.
16094 */
16095 
16096 void
16098  SYS_MODULE_OBJ object ) ;
16099 // *****************************************************************************
16100 /* Function:
16101  SYS_STATUS DRV_USART_Status( SYS_MODULE_OBJ object )
16102  Summary:
16103  Gets the current status of the USART driver module.
16104  <p><b>Implementation:</b> Static/Dynamic</p>
16105  Description:
16106  This routine provides the current status of the USART driver module.
16107  Precondition:
16108  Function DRV_USART_Initialize should have been called before calling this
16109  function.
16110  Parameters:
16111  object - Driver object handle, returned from the
16112  DRV_USART_Initialize routine
16113  Returns:
16114  SYS_STATUS_READY - Indicates that the driver is busy with a
16115  previous system level operation and cannot start
16116  another
16117  SYS_STATUS_DEINITIALIZED - Indicates that the driver has been
16118  deinitialized
16119  Example:
16120  <code>
16121  SYS_MODULE_OBJ object; // Returned from DRV_USART_Initialize
16122  SYS_STATUS usartStatus;
16123  usartStatus = DRV_USART _Status(object);
16124  if (SYS_STATUS_READY == usartStatus)
16125  {
16126  // This means the driver can be opened using the
16127  // DRV_USART_Open() function.
16128  }
16129  </code>
16130  Remarks:
16131  A driver can opened only when its status is SYS_STATUS_READY.
16132 */
16133 
16134 SYS_STATUS
16136  SYS_MODULE_OBJ object ) ;
16137 // *****************************************************************************
16138 /* Function:
16139  void DRV_USART_TasksTransmit (SYS_MODULE_OBJ object );
16140  Summary:
16141  Maintains the driver's transmit state machine and implements its ISR.
16142  <p><b>Implementation:</b> Static/Dynamic</p>
16143  Description:
16144  This routine is used to maintain the driver's internal transmit state
16145  machine and implement its transmit ISR for interrupt-driven implementations.
16146  In polling mode, this function should be called from the SYS_Tasks
16147  function. In interrupt mode, this function should be called in the transmit
16148  interrupt service routine of the USART that is associated with this USART
16149  driver hardware instance.
16150  Precondition:
16151  The DRV_USART_Initialize routine must have been called for the specified
16152  USART driver instance.
16153  Parameters:
16154  object - Object handle for the specified driver instance (returned from
16155  DRV_USART_Initialize)
16156  Returns:
16157  None.
16158  Example:
16159  <code>
16160  SYS_MODULE_OBJ object; // Returned from DRV_USART_Initialize
16161  while (true)
16162  {
16163  DRV_USART_TasksTransmit (object);
16164  // Do other tasks
16165  }
16166  </code>
16167  Remarks:
16168  This routine is normally not called directly by an application. It is
16169  called by the system's Tasks routine (SYS_Tasks) or by the appropriate raw
16170  ISR.
16171  This routine may execute in an ISR context and will never block or access any
16172  resources that may cause it to block.
16173 */
16174 
16175 void
16177  SYS_MODULE_OBJ object ) ;
16178 // *****************************************************************************
16179 /* Function:
16180  void DRV_USART_TasksReceive (SYS_MODULE_OBJ object );
16181  Summary:
16182  Maintains the driver's receive state machine and implements its ISR.
16183  <p><b>Implementation:</b> Static/Dynamic</p>
16184  Description:
16185  This routine is used to maintain the driver's internal receive state machine
16186  and implement its receive ISR for interrupt-driven implementations. In
16187  polling mode, this function should be called from the SYS_Tasks function.
16188  In interrupt mode, this function should be called in the receive interrupt
16189  service routine of the USART that is associated with this USART driver
16190  hardware instance.
16191  Precondition:
16192  The DRV_USART_Initialize routine must have been called for the specified
16193  USART driver instance.
16194  Parameters:
16195  object - Object handle for the specified driver instance (returned from
16196  DRV_USART_Initialize)
16197  Returns:
16198  None.
16199  Example:
16200  <code>
16201  SYS_MODULE_OBJ object; // Returned from DRV_USART_Initialize
16202  while (true)
16203  {
16204  DRV_USART_TasksReceive (object);
16205  // Do other tasks
16206  }
16207  </code>
16208  Remarks:
16209  This routine is normally not called directly by an application. It is
16210  called by the system's Tasks routine (SYS_Tasks) or by the appropriate raw
16211  ISR.
16212  This routine may execute in an ISR context and will never block or access any
16213  resources that may cause it to block.
16214 */
16215 
16216 void
16218  SYS_MODULE_OBJ object ) ;
16219 // *****************************************************************************
16220 /* Function:
16221  void DRV_USART_TasksError (SYS_MODULE_OBJ object );
16222  Summary:
16223  Maintains the driver's error state machine and implements its ISR.
16224  <p><b>Implementation:</b> Static/Dynamic</p>
16225  Description:
16226  This routine is used to maintain the driver's internal error state machine
16227  and implement its error ISR for interrupt-driven implementations. In
16228  polling mode, this function should be called from the SYS_Tasks function.
16229  In interrupt mode, this function should be called in the error interrupt
16230  service routine of the USART that is associated with this USART driver
16231  hardware instance.
16232  Precondition:
16233  The DRV_USART_Initialize routine must have been called for the specified
16234  USART driver instance.
16235  Parameters:
16236  object - Object handle for the specified driver instance (returned from
16237  DRV_USART_Initialize)
16238  Returns:
16239  None.
16240  Example:
16241  <code>
16242  SYS_MODULE_OBJ object; // Returned from DRV_USART_Initialize
16243  while (true)
16244  {
16245  DRV_USART_TasksError (object);
16246  // Do other tasks
16247  }
16248  </code>
16249  Remarks:
16250  This routine is normally not called directly by an application. It is
16251  called by the system's Tasks routine (SYS_Tasks) or by the appropriate raw
16252  ISR.
16253  This routine may execute in an ISR context and will never block or access any
16254  resources that may cause it to block.
16255 */
16256 
16257 void
16259  SYS_MODULE_OBJ object ) ;
16260 // *****************************************************************************
16261 // *****************************************************************************
16262 // Section: USART Driver Client Routines
16263 // *****************************************************************************
16264 // *****************************************************************************
16265 // *****************************************************************************
16266 /* Function:
16267  DRV_HANDLE DRV_USART_Open
16268  (
16269  const SYS_MODULE_INDEX index,
16270  const DRV_IO_INTENT ioIntent
16271  )
16272  Summary:
16273  Opens the specified USART driver instance and returns a handle to it.
16274  <p><b>Implementation:</b> Static/Dynamic</p>
16275  Description:
16276  This routine opens the specified USART driver instance and provides a
16277  handle that must be provided to all other client-level operations to
16278  identify the caller and the instance of the driver. The ioIntent
16279  parameter defines how the client interacts with this driver instance.
16280  The DRV_IO_INTENT_BLOCKING and DRV_IO_INTENT_NONBLOCKING ioIntent options
16281  additionally affect the behavior of the DRV_USART_Read and
16282  DRV_USART_Write functions. If the ioIntent is DRV_IO_INTENT_NONBLOCKING,
16283  then these function will not block even if the required amount of data could
16284  not be processed. If the ioIntent is DRV_IO_INTENT_BLOCKING, these functions
16285  will block until the required amount of data is processed. If the driver is
16286  configured for polling and bare-metal operation, it will not support
16287  DRV_IO_INTENT_BLOCKING. The driver will operation will always be
16288  non-blocking.
16289  If ioIntent is DRV_IO_INTENT_READ, the client will only be able to read from
16290  the driver. If ioIntent is DRV_IO_INTENT_WRITE, the client will only be able
16291  to write to the driver. If the ioIntent is DRV_IO_INTENT_READWRITE, the
16292  client will be able to do both, read and write.
16293  Specifying a DRV_IO_INTENT_EXCLUSIVE will cause the driver to provide
16294  exclusive access to this client. The driver cannot be opened by any
16295  other client.
16296  Precondition:
16297  Function DRV_USART_Initialize must have been called before calling this
16298  function.
16299  Parameters:
16300  index - Identifier for the object instance to be opened
16301  intent - Zero or more of the values from the enumeration
16302  DRV_IO_INTENT "ORed" together to indicate the intended use
16303  of the driver. See function description for details.
16304  Returns:
16305  If successful, the routine returns a valid open-instance handle (a number
16306  identifying both the caller and the module instance).
16307  If an error occurs, the return value is DRV_HANDLE_INVALID. Error can occur
16308  - if the number of client objects allocated via DRV_USART_CLIENTS_NUMBER is
16309  insufficient.
16310  - if the client is trying to open the driver but driver has been opened
16311  exclusively by another client.
16312  - if the driver hardware instance being opened is not initialized or is
16313  invalid.
16314  - if the client is trying to open the driver exclusively, but has already
16315  been opened in a non exclusive mode by another client.
16316  - if the driver is not ready to be opened, typically when the initialize
16317  routine has not completed execution.
16318  Example:
16319  <code>
16320  DRV_HANDLE handle;
16321  handle = DRV_USART_Open(DRV_USART_INDEX_0, DRV_IO_INTENT_EXCLUSIVE);
16322  if (DRV_HANDLE_INVALID == handle)
16323  {
16324  // Unable to open the driver
16325  // May be the driver is not initialized or the initialization
16326  // is not complete.
16327  }
16328  </code>
16329  Remarks:
16330  The handle returned is valid until the DRV_USART_Close routine is called.
16331  This routine will NEVER block waiting for hardware.If the requested intent
16332  flags are not supported, the routine will return DRV_HANDLE_INVALID. This
16333  function is thread safe in a RTOS application.
16334 */
16335 
16336 DRV_HANDLE
16337  DRV_USART_Open (
16338  const SYS_MODULE_INDEX index ,
16339  const DRV_IO_INTENT ioIntent ) ;
16340 // *****************************************************************************
16341 /* Function:
16342  void DRV_USART_Close( DRV_Handle handle )
16343  Summary:
16344  Closes an opened-instance of the USART driver.
16345  <p><b>Implementation:</b> Static/Dynamic</p>
16346  Description:
16347  This routine closes an opened-instance of the USART driver, invalidating the
16348  handle. Any buffers in the driver queue that were submitted by this client
16349  will be removed. After calling this routine, the handle passed in "handle"
16350  must not be used with any of the remaining driver routines (with one
16351  possible exception described in the "Remarks" section). A new handle must
16352  be obtained by calling DRV_USART_Open before the caller may use the driver
16353  again
16354  Precondition:
16355  The DRV_USART_Initialize routine must have been called for the specified
16356  USART driver instance.
16357  DRV_USART_Open must have been called to obtain a valid opened device handle.
16358  Parameters:
16359  handle - A valid open-instance handle, returned from the driver's
16360  open routine
16361  Returns:
16362  None.
16363  Example:
16364  <code>
16365  DRV_HANDLE handle; // Returned from DRV_USART_Open
16366  DRV_USART_Close(handle);
16367  // After this point, the handle cannot be used with any other function
16368  // except the DRV_USART_ClientStatus function, which can be used to query
16369  // the success status of the DRV_USART_Close function.
16370  while(DRV_USART_CLIENT_STATUS_CLOSED != DRV_USART_ClientStatus(handle));
16371  </code>
16372  Remarks:
16373  Usually there is no need for the client to verify that the Close operation
16374  has completed. The driver will abort any ongoing operations when this
16375  routine is called. However, if it requires additional time to do so in a
16376  non-blocking environment, it will still return from the Close operation but
16377  the handle is now a zombie handle. The client can only call the
16378  DRV_USART_ClientStatus on a zombie handle to track the completion of the
16379  Close operation. The DRV_USART_ClientStatus routine will return
16380  DRV_CLIENT_STATUS_CLOSED when the close operation has completed.
16381 */
16382 
16383 void
16384  DRV_USART_Close (
16385  const DRV_HANDLE handle ) ;
16386 // *****************************************************************************
16387 /*
16388  Function:
16389  DRV_USART_CLIENT_STATUS DRV_USART_ClientStatus( DRV_HANDLE handle )
16390  Summary:
16391  Gets the current client-specific status the USART driver.
16392  <p><b>Implementation:</b> Static/Dynamic</p>
16393  Description:
16394  This function gets the client-specific status of the USART driver associated
16395  with the given handle. This function can be used to check the status of
16396  client after the DRV_USART_Close() function has been called.
16397  Preconditions:
16398  The DRV_USART_Initialize function must have been called.
16399  DRV_USART_Open must have been called to obtain a valid opened device
16400  handle.
16401  Parameters:
16402  handle - Handle returned from the driver's open function.
16403  Returns:
16404  A DRV_USART_CLIENT_STATUS value describing the current status of the
16405  driver.
16406  Example:
16407  <code>
16408  DRV_HANDLE handle; // Returned from DRV_USART_Open
16409  DRV_USART_CLIENT_STATUS status;
16410  status = DRV_USART_ClientStatus(handle);
16411  if( DRV_USART_CLIENT_STATUS_CLOSED != status )
16412  {
16413  // The client had not closed.
16414  }
16415  </code>
16416  Remarks:
16417  This function will not block for hardware access and will immediately return
16418  the current status. This function is thread safe when called in a RTOS
16419  application.
16420 */
16421 
16424  DRV_HANDLE handle ) ;
16425 // *****************************************************************************
16426 // *****************************************************************************
16427 // Section: USART Driver Buffer Queuing Model Interface Routines
16428 // *****************************************************************************
16429 // *****************************************************************************
16430 // *****************************************************************************
16431 /* Function:
16432  void DRV_USART_BufferAddWrite
16433  (
16434  const DRV_HANDLE handle,
16435  DRV_USART_BUFFER_HANDLE * bufferHandle,
16436  void * buffer,
16437  size_t size
16438  );
16439  Summary:
16440  Schedule a non-blocking driver write operation.
16441  <p><b>Implementation:</b> Static/Dynamic</p>
16442  Description:
16443  This function schedules a non-blocking write operation. The function returns
16444  with a valid buffer handle in the bufferHandle argument if the write request
16445  was scheduled successfully. The function adds the request to the hardware
16446  instance transmit queue and returns immediately. While the request is in the
16447  queue, the application buffer is owned by the driver and should not be
16448  modified. On returning, the bufferHandle parameter may be
16449  DRV_USART_BUFFER_HANDLE_INVALID for the following reasons:
16450  - if a buffer could not be allocated to the request
16451  - if the input buffer pointer is NULL
16452  - if the client opened the driver for read-only
16453  - if the buffer size is 0
16454  - if the transmit queue is full or the queue depth is insufficient
16455  If the requesting client registered an event callback with the driver, the
16456  driver will issue a DRV_USART_BUFFER_EVENT_COMPLETE event if the buffer was
16457  processed successfully or a DRV_USART_BUFFER_EVENT_ERROR event if the buffer
16458  was not processed successfully.
16459  Precondition:
16460  The DRV_USART_Initialize routine must have been called for the specified
16461  USART device instance and the DRV_USART_Status must have returned
16462  SYS_STATUS_READY.
16463  DRV_USART_Open must have been called to obtain a valid opened device handle.
16464  DRV_IO_INTENT_WRITE or DRV_IO_INTENT_READWRITE must have been specified in
16465  the DRV_USART_Open call.
16466  Parameters:
16467  handle - Handle of the communication channel as return by the
16468  DRV_USART_Open function.
16469  bufferHandle - Pointer to an argument that will contain the return buffer handle.
16470  buffer - Data to be transmitted.
16471  size - Buffer size in bytes.
16472  Returns:
16473  The bufferHandle parameter will contain the return buffer handle. This will be
16474  DRV_USART_BUFFER_HANDLE_INVALID if the function was not successful.
16475  Example:
16476  <code>
16477  MY_APP_OBJ myAppObj;
16478  uint8_t mybuffer[MY_BUFFER_SIZE];
16479  DRV_USART_BUFFER_HANDLE bufferHandle;
16480  // myUSARTHandle is the handle returned
16481  // by the DRV_USART_Open function.
16482  // Client registers an event handler with driver
16483  DRV_USART_BufferEventHandlerSet(myUSARTHandle,
16484  APP_USARTBufferEventHandler, (uintptr_t)&myAppObj);
16485  DRV_USART_BufferAddWrite(myUSARThandle, &bufferHandle,
16486  myBuffer, MY_BUFFER_SIZE);
16487  if(DRV_USART_BUFFER_HANDLE_INVALID == bufferHandle)
16488  {
16489  // Error handling here
16490  }
16491  // Event is received when
16492  // the buffer is processed.
16493  void APP_USARTBufferEventHandler(DRV_USART_BUFFER_EVENT event,
16494  DRV_USART_BUFFER_HANDLE bufferHandle, uintptr_t contextHandle)
16495  {
16496  // contextHandle points to myAppObj.
16497  switch(event)
16498  {
16499  case DRV_USART_BUFFER_EVENT_COMPLETE:
16500  // This means the data was transferred.
16501  break;
16502  case DRV_USART_BUFFER_EVENT_ERROR:
16503  // Error handling here.
16504  break;
16505  default:
16506  break;
16507  }
16508  }
16509  </code>
16510  Remarks:
16511  This function is thread safe in a RTOS application. It can be called from
16512  within the USART Driver Buffer Event Handler that is registered by this
16513  client. It should not be called in the event handler associated with another
16514  USART driver instance. It should not otherwise be called directly in an ISR.
16515 */
16516 
16517 void
16519  const DRV_HANDLE handle ,
16520  DRV_USART_BUFFER_HANDLE * bufferHandle ,
16521  void * buffer ,
16522  const size_t size ) ;
16523 // *****************************************************************************
16524 /* Function:
16525  void DRV_USART_AddressedBufferAddWrite
16526  (
16527  const DRV_HANDLE hClient,
16528  DRV_USART_BUFFER_HANDLE * bufferHandle,
16529  uint8_t address,
16530  void * source,
16531  size_t nWords
16532  );
16533  Summary:
16534  Schedule a non-blocking addressed driver write operation.
16535  <p><b>Implementation:</b> Dynamic</p>
16536  Description:
16537  This function schedules a non-blocking addressed write operation. The function returns
16538  with a valid buffer handle in the bufferHandle argument if the addressed write request
16539  was scheduled successfully. The function adds the request to the hardware
16540  instance transmit queue and returns immediately. While the request is in the
16541  queue, the application buffer is owned by the driver and should not be
16542  modified. On returning, the bufferHandle parameter may be
16543  DRV_USART_BUFFER_HANDLE_INVALID for the following reasons:
16544  - if a buffer could not be allocated to the request
16545  - if the input buffer pointer is NULL
16546  - if the client opened the driver for read-only
16547  - if the buffer size is 0
16548  - if the transmit queue is full or the queue depth is insufficient
16549  If the requesting client registered an event callback with the driver, the
16550  driver will issue a DRV_USART_BUFFER_EVENT_COMPLETE event if the buffer was
16551  processed successfully or a DRV_USART_BUFFER_EVENT_ERROR event if the buffer
16552  was not processed successfully.
16553  Precondition:
16554  The DRV_USART_Initialize routine must have been called for the specified
16555  USART device instance and the DRV_USART_Status must have returned
16556  SYS_STATUS_READY.
16557  DRV_USART_Open must have been called to obtain a valid opened device handle.
16558  DRV_IO_INTENT_WRITE or DRV_IO_INTENT_READWRITE must have been specified in
16559  the DRV_USART_Open call.
16560  The operation mode of the driver must be DRV_USART_OPERATION_MODE_ADDRESSED.
16561  Parameters:
16562  hClient - Handle of the communication channel as return by the
16563  DRV_USART_Open function.
16564  bufferHandle - Pointer to an argument that will contain the return buffer handle.
16565  address - Address of the receiver client
16566  source - Data to be transmitted.
16567  size - Buffer size in 16-bit words.
16568  Returns:
16569  The bufferHandle parameter will contain the return buffer handle. This will be
16570  DRV_USART_BUFFER_HANDLE_INVALID if the function was not successful.
16571  Example:
16572  <code>
16573  MY_APP_OBJ myAppObj;
16574  uint16_t mybuffer[MY_BUFFER_SIZE];
16575  DRV_USART_BUFFER_HANDLE bufferHandle;
16576  uint8_t clientAddress;
16577  // myUSARTHandle is the handle returned
16578  // by the DRV_USART_Open function.
16579  // Client registers an event handler with driver
16580  clientAddress = 0x60;
16581  DRV_USART_BufferEventHandlerSet(myUSARTHandle,
16582  APP_USARTBufferEventHandler, (uintptr_t)&myAppObj);
16583  DRV_USART_AddressedBufferAddWrite(myUSARThandle, &bufferHandle, clientAddress
16584  myBuffer, MY_BUFFER_SIZE);
16585  if(DRV_USART_BUFFER_HANDLE_INVALID == bufferHandle)
16586  {
16587  // Error handling here
16588  }
16589  // Event is received when
16590  // the buffer is processed.
16591  void APP_USARTBufferEventHandler(DRV_USART_BUFFER_EVENT event,
16592  DRV_USART_BUFFER_HANDLE bufferHandle, uintptr_t contextHandle)
16593  {
16594  // contextHandle points to myAppObj.
16595  switch(event)
16596  {
16597  case DRV_USART_BUFFER_EVENT_COMPLETE:
16598  // This means the data was transferred.
16599  break;
16600  case DRV_USART_BUFFER_EVENT_ERROR:
16601  // Error handling here.
16602  break;
16603  default:
16604  break;
16605  }
16606  }
16607  </code>
16608  Remarks:
16609  This function is thread safe in a RTOS application. It can be called from
16610  within the USART Driver Buffer Event Handler that is registered by this
16611  client. It should not be called in the event handler associated with another
16612  USART driver instance. It should not otherwise be called directly in an ISR.
16613  The source buffer should be a 16-bit word aligned buffer.
16614  The 9th bit of the higher byte 16-bit buffer is used to indicate data/address.
16615 */
16616 
16617 void
16619  const DRV_HANDLE hClient ,
16620  DRV_USART_BUFFER_HANDLE * bufferHandle ,
16621  uint8_t address ,
16622  void * source ,
16623  size_t nWords ) ;
16624 // *****************************************************************************
16625 /* Function:
16626  void DRV_USART_BufferAddRead
16627  (
16628  const DRV_HANDLE handle,
16629  DRV_USART_BUFFER_HANDLE * bufferHandle,
16630  void * buffer,
16631  const size_t size
16632  )
16633  Summary:
16634  Schedule a non-blocking driver read operation.
16635  <p><b>Implementation:</b> Static/Dynamic</p>
16636  Description:
16637  This function schedules a non-blocking read operation. The function returns
16638  with a valid buffer handle in the bufferHandle argument if the read request
16639  was scheduled successfully. The function adds the request to the hardware
16640  instance receive queue and returns immediately. While the request is in the
16641  queue, the application buffer is owned by the driver and should not be
16642  modified. The function returns DRV_USART_BUFFER_HANDLE_INVALID in the
16643  bufferHandle argument:
16644  - if a buffer could not be allocated to the request
16645  - if the input buffer pointer is NULL
16646  - if the buffer size is 0
16647  - if the read queue size is full or queue depth is insufficient.
16648  - if the driver handle is invalid
16649  If the requesting client registered an event callback with the driver, the
16650  driver will issue a DRV_USART_BUFFER_EVENT_COMPLETE event if the buffer was
16651  processed successfully of DRV_USART_BUFFER_EVENT_ERROR event if the buffer
16652  was not processed successfully.
16653  Precondition:
16654  The DRV_USART_Initialize routine must have been called for the specified
16655  USART device instance and the DRV_USART_Status must have returned
16656  SYS_STATUS_READY.
16657  DRV_USART_Open must have been called to obtain a valid opened device handle.
16658  DRV_IO_INTENT_READ or DRV_IO_INTENT_READWRITE must have been specified in
16659  the DRV_USART_Open call.
16660  Parameters:
16661  handle - Handle of the communication channel as returned by the
16662  DRV_USART_Open function.
16663  buffer - Buffer where the received data will be stored.
16664  size - Buffer size in bytes.
16665  Returns:
16666  The buffer handle is returned in the bufferHandle argument. This is
16667  DRV_USART_BUFFER_HANDLE_INVALID if the request was not successful.
16668  Example:
16669  <code>
16670  MY_APP_OBJ myAppObj;
16671  uint8_t mybuffer[MY_BUFFER_SIZE];
16672  DRV_USART_BUFFER_HANDLE bufferHandle;
16673  // myUSARTHandle is the handle returned
16674  // by the DRV_USART_Open function.
16675  // Client registers an event handler with driver
16676  DRV_USART_BufferEventHandlerSet(myUSARTHandle,
16677  APP_USARTBufferEventHandler, (uintptr_t)&myAppObj);
16678  DRV_USART_BufferAddRead(myUSARThandle, &bufferHandle,
16679  myBuffer, MY_BUFFER_SIZE);
16680  if(DRV_USART_BUFFER_HANDLE_INVALID == bufferHandle)
16681  {
16682  // Error handling here
16683  }
16684  // Event is received when
16685  // the buffer is processed.
16686  void APP_USARTBufferEventHandler(DRV_USART_BUFFER_EVENT event,
16687  DRV_USART_BUFFER_HANDLE bufferHandle, uintptr_t contextHandle)
16688  {
16689  // contextHandle points to myAppObj.
16690  switch(event)
16691  {
16692  case DRV_USART_BUFFER_EVENT_COMPLETE:
16693  // This means the data was transferred.
16694  break;
16695  case DRV_USART_BUFFER_EVENT_ERROR:
16696  // Error handling here.
16697  break;
16698  default:
16699  break;
16700  }
16701  }
16702  </code>
16703  Remarks:
16704  This function is thread safe in a RTOS application. It can be called from
16705  within the USART Driver Buffer Event Handler that is registered by the
16706  client. It should not be called in the event handler associated with another
16707  USART driver instance. It should not be called directly in an ISR.
16708 */
16709 
16710 void
16712  const DRV_HANDLE handle ,
16713  DRV_USART_BUFFER_HANDLE * const bufferHandle ,
16714  void * buffer ,
16715  const size_t size ) ;
16716 // *****************************************************************************
16717 /* Function:
16718  void DRV_USART_BufferEventHandlerSet
16719  (
16720  const DRV_HANDLE handle,
16721  const DRV_USART_BUFFER_EVENT_HANDLER eventHandler,
16722  const uintptr_t context
16723  )
16724  Summary:
16725  Allows a client to identify a buffer event handling function for the driver
16726  to call back when queued buffer transfers have finished.
16727  <p><b>Implementation:</b> Static/Dynamic</p>
16728  Description:
16729  This function allows a client to identify a buffer event handling function
16730  for the driver to call back when queued buffer transfers have finished.
16731  When a client calls either the DRV_USART_BufferAddRead or
16732  DRV_USART_BufferAddWrite function, it is provided with a handle identifying
16733  the buffer that was added to the driver's buffer queue. The driver will
16734  pass this handle back to the client by calling "eventHandler" function when
16735  the buffer transfer has completed.
16736  The event handler should be set before the client performs any "buffer add"
16737  operations that could generate events. The event handler once set, persists
16738  until the client closes the driver or sets another event handler (which
16739  could be a "NULL" pointer to indicate no callback).
16740  Precondition:
16741  The DRV_USART_Initialize routine must have been called for the specified
16742  USART driver instance.
16743  DRV_USART_Open must have been called to obtain a valid opened device handle.
16744  Parameters:
16745  handle - A valid open-instance handle, returned from the driver's
16746  open routine
16747  eventHandler - Pointer to the event handler function.
16748  context - The value of parameter will be passed back to the client
16749  unchanged, when the eventHandler function is called. It can
16750  be used to identify any client specific data object that
16751  identifies the instance of the client module (for example,
16752  it may be a pointer to the client module's state structure).
16753  Returns:
16754  None.
16755  Example:
16756  <code>
16757  // myAppObj is an application specific state data object.
16758  MY_APP_OBJ myAppObj;
16759  uint8_t mybuffer[MY_BUFFER_SIZE];
16760  DRV_USART_BUFFER_HANDLE bufferHandle;
16761  // myUSARTHandle is the handle returned
16762  // by the DRV_USART_Open function.
16763  // Client registers an event handler with driver. This is done once
16764  DRV_USART_BufferEventHandlerSet( myUSARTHandle, APP_USARTBufferEventHandle,
16765  (uintptr_t)&myAppObj );
16766  DRV_USART_BufferAddRead(myUSARThandle, &bufferHandle
16767  myBuffer, MY_BUFFER_SIZE);
16768  if(DRV_USART_BUFFER_HANDLE_INVALID == bufferHandle)
16769  {
16770  // Error handling here
16771  }
16772  // Event Processing Technique. Event is received when
16773  // the buffer is processed.
16774  void APP_USARTBufferEventHandler(DRV_USART_BUFFER_EVENT event,
16775  DRV_USART_BUFFER_HANDLE handle, uintptr_t context)
16776  {
16777  // The context handle was set to an application specific
16778  // object. It is now retrievable easily in the event handler.
16779  MY_APP_OBJ myAppObj = (MY_APP_OBJ *) context;
16780  switch(event)
16781  {
16782  case DRV_USART_BUFFER_EVENT_COMPLETE:
16783  // This means the data was transferred.
16784  break;
16785  case DRV_USART_BUFFER_EVENT_ERROR:
16786  // Error handling here.
16787  break;
16788  default:
16789  break;
16790  }
16791  }
16792  </code>
16793  Remarks:
16794  If the client does not want to be notified when the queued buffer transfer
16795  has completed, it does not need to register a callback. This function is
16796  thread safe when called in a RTOS application.
16797 */
16798 
16799 void
16801  const DRV_HANDLE handle ,
16802  const DRV_USART_BUFFER_EVENT_HANDLER eventHandler ,
16803  const uintptr_t context ) ;
16804 // *****************************************************************************
16805 /* Function:
16806  DRV_USART_BUFFER_RESULT DRV_USART_BufferRemove( DRV_USART_BUFFER_HANDLE bufferHandle )
16807  Summary:
16808  Removes a requested buffer from the queue.
16809  <p><b>Implementation:</b> Static/Dynamic</p>
16810  Description:
16811  This function removes a specified buffer from the queue.
16812  The client can use this function to delete
16813  1. An unwated stalled buffer.
16814  2. Queued buffers on timeout.
16815  or in any other use case.
16816  Precondition:
16817  The DRV_USART_Initialize routine must have been called for the specified
16818  USART driver instance.
16819  DRV_USART_Open must have been called to obtain a valid opened device handle.
16820  Either the DRV_USART_BufferAddRead or DRV_USART_BufferAddWrite function
16821  must have been called and a valid buffer handle returned.
16822  Parameters:
16823  bufferhandle - Handle of the buffer to delete.
16824  Returns:
16825  DRV_USART_BUFFER_RESULT_HANDLE_INVALID - Buffer handle is invalid.
16826  DRV_USART_BUFFER_RESULT_HANDLE_EXPIRED - Buffer handle is expired.
16827  DRV_USART_BUFFER_RESULT_REMOVED_SUCCESFULLY - Buffer is removed from the
16828  queue successfully.
16829  DRV_USART_BUFFER_RESULT_REMOVAL_FAILED - Failed to remove buffer from
16830  the queue because of mutex timeout in RTOS environment.
16831  Example:
16832  <code>
16833  // myAppObj is an application specific object.
16834  MY_APP_OBJ myAppObj;
16835  uint8_t mybuffer[MY_BUFFER_SIZE];
16836  DRV_USART_BUFFER_HANDLE bufferHandle;
16837  // myUSARTHandle is the handle returned
16838  // by the DRV_USART_Open function.
16839  // Client registers an event handler with driver. This is done once
16840  DRV_USART_BufferEventHandlerSet( myUSARTHandle, APP_USARTBufferEventHandle,
16841  (uintptr_t)&myAppObj );
16842  bufferHandle = DRV_USART_BufferAddRead( myUSARThandle,
16843  myBuffer, MY_BUFFER_SIZE );
16844  if(DRV_USART_BUFFER_HANDLE_INVALID == bufferHandle)
16845  {
16846  // Error handling here
16847  }
16848  // Event Processing Technique. Event is received when
16849  // the buffer is processed.
16850  void APP_USARTBufferEventHandler( DRV_USART_BUFFER_EVENT event,
16851  DRV_USART_BUFFER_HANDLE bufferHandle, uintptr_t contextHandle )
16852  {
16853  switch(event)
16854  {
16855  case DRV_USART_BUFFER_EVENT_COMPLETE:
16856  // This means the data was transferred.
16857  break;
16858  case DRV_USART_BUFFER_EVENT_ERROR:
16859  // Error handling here.
16860  break;
16861  default:
16862  break;
16863  }
16864  }
16865  // Timeout function, where remove queued buffer if it still exists.
16866  void APP_TimeOut(void)
16867  {
16868  DRV_USART_BUFFER_RESULT bufferResult;
16869  bufferResult = DRV_USART_BufferRemove(bufferHandle);
16870  if(DRV_USART_BUFFER_RESULT_REMOVED_SUCCESFULLY == bufferResult)
16871  {
16872  //Buffer removed succesfully from the queue
16873  }
16874  else
16875  {
16876  //Either buffer is invalid or expired.
16877  //Or not able to acquire mutex in RTOS mode.
16878  }
16879  }
16880  </code>
16881  Remarks:
16882  This function is thread safe when used in a RTOS application.
16883 */
16884 
16887  DRV_USART_BUFFER_HANDLE bufferHandle ) ;
16888 // *****************************************************************************
16889 /* Function:
16890  size_t DRV_USART_BufferCompletedBytesGet
16891  (
16892  DRV_USART_BUFFER_HANDLE bufferHandle
16893  );
16894  Summary:
16895  Returns the number of bytes that have been processed for the
16896  specified buffer.
16897  <p><b>Implementation:</b> Static/Dynamic</p>
16898  Description:
16899  This function returns number of bytes that have been processed for the
16900  specified buffer. The client can use this function, in a case where the
16901  buffer has terminated due to an error, to obtain the number of bytes that
16902  have been processed. Or in any other use case.
16903  This function can be used for non-DMA buffer transfers only. It cannot be
16904  used when the USART driver is configured to use DMA.
16905  Precondition:
16906  The DRV_USART_Initialize routine must have been called for the specified
16907  USART driver instance.
16908  DRV_USART_Open must have been called to obtain a valid opened device handle.
16909  Either the DRV_USART_BufferAddRead or DRV_USART_BufferAddWrite function
16910  must have been called and a valid buffer handle returned.
16911  Parameters:
16912  bufferhandle - Handle for the buffer of which the processed number of bytes
16913  to be obtained.
16914  Returns:
16915  Returns the number of bytes that have been processed for this buffer.
16916  Returns DRV_USART_BUFFER_HANDLE_INVALID for an invalid or an expired
16917  buffer handle.
16918  Example:
16919  <code>
16920  // myAppObj is an application specific object.
16921  MY_APP_OBJ myAppObj;
16922  uint8_t mybuffer[MY_BUFFER_SIZE];
16923  DRV_USART_BUFFER_HANDLE bufferHandle;
16924  // myUSARTHandle is the handle returned
16925  // by the DRV_USART_Open function.
16926  // Client registers an event handler with driver. This is done once
16927  DRV_USART_BufferEventHandlerSet( myUSARTHandle, APP_USARTBufferEventHandle,
16928  (uintptr_t)&myAppObj );
16929  bufferHandle = DRV_USART_BufferAddRead( myUSARThandle,
16930  myBuffer, MY_BUFFER_SIZE );
16931  if(DRV_USART_BUFFER_HANDLE_INVALID == bufferHandle)
16932  {
16933  // Error handling here
16934  }
16935  // Event Processing Technique. Event is received when
16936  // the buffer is processed.
16937  void APP_USARTBufferEventHandler( DRV_USART_BUFFER_EVENT event,
16938  DRV_USART_BUFFER_HANDLE bufferHandle, uintptr_t contextHandle )
16939  {
16940  // The context handle was set to an application specific
16941  // object. It is now retrievable easily in the event handler.
16942  MY_APP_OBJ myAppObj = (MY_APP_OBJ *) contextHandle;
16943  size_t processedBytes;
16944  switch(event)
16945  {
16946  case DRV_USART_BUFFER_EVENT_COMPLETE:
16947  // This means the data was transferred.
16948  break;
16949  case DRV_USART_BUFFER_EVENT_ERROR:
16950  // Error handling here.
16951  // We can find out how many bytes were processed in this
16952  // buffer before the error occurred.
16953  processedBytes = DRV_USART_BufferCompletedBytesGet(bufferHandle);
16954  break;
16955  default:
16956  break;
16957  }
16958  }
16959  </code>
16960  Remarks:
16961  This function is thread safe when used in a RTOS application.
16962 */
16963 
16964 size_t
16966  DRV_USART_BUFFER_HANDLE bufferHandle ) ;
16967 // *****************************************************************************
16968 /* Function:
16969  size_t DRV_USART_BufferProcessedSizeGet
16970  (
16971  DRV_USART_BUFFER_HANDLE bufferHandle
16972  );
16973  Summary:
16974  This API will be deprecated and not recommended to use.
16975  Use DRV_USART_BufferCompletedBytesGet to get the number of bytes
16976  processed for the specified buffer.
16977  Description:
16978  None.
16979  Precondition:
16980  None.
16981  Parameters:
16982  None.
16983  Returns:
16984  None.
16985  Example:
16986  None.
16987  Remarks:
16988  None.
16989 */
16990 
16991 size_t
16993  DRV_USART_BUFFER_HANDLE bufferHandle ) ;
16994 // *****************************************************************************
16995 // *****************************************************************************
16996 // Section: USART Driver File System Model Routines
16997 // *****************************************************************************
16998 // *****************************************************************************
16999 // *****************************************************************************
17000 /* Function:
17001  size_t DRV_USART_Read
17002  (
17003  const DRV_HANDLE handle,
17004  void * buffer,
17005  const size_t numbytes
17006  )
17007  Summary:
17008  Reads data from the USART.
17009  <p><b>Implementation:</b> Static/Dynamic</p>
17010  Description:
17011  This routine reads data from the USART. This function is blocking if the
17012  driver was opened by the client for blocking operation. This function will
17013  not block if the driver was opened by the client for non blocking operation.
17014  If the ioIntent parameter at the time of opening the driver was
17015  DRV_IO_INTENT_BLOCKING, this function will only return when (or will block
17016  until) numbytes of bytes have been received or if an error occurred. If there
17017  are buffers queued for receiving data, these buffers will be serviced first. The
17018  function will not return until the requested number of bytes have been read.
17019  If the ioIntent parameter at the time of opening the driver was
17020  DRV_IO_INTENT_NON_BLOCKING, this function will return with the number of
17021  bytes that were actually read. The function will not wait until numBytes of
17022  bytes have been read. If there are buffer queued for reading data, then the
17023  function will not block and will return immediately with 0 bytes read.
17024  Precondition:
17025  The DRV_USART_Initialize routine must have been called for the specified
17026  USART driver instance.
17027  DRV_USART_Open must have been called to obtain a valid opened device handle.
17028  DRV_IO_INTENT_READ or DRV_IO_INTENT_READWRITE must have been specified in
17029  the DRV_USART_Open call.
17030  Parameters:
17031  handle - A valid open-instance handle, returned from the driver's
17032  open routine
17033  buffer - Buffer into which the data read from the USART instance
17034  will be placed.
17035  numbytes - Total number of bytes that need to be read from the module
17036  instance (must be equal to or less than the size of the
17037  buffer)
17038  Returns:
17039  Number of bytes actually copied into the caller's buffer. Returns
17040  DRV_USART_READ_ERROR in case of an error.
17041  Example:
17042  <code>
17043  DRV_HANDLE myUSARTHandle; // Returned from DRV_USART_Open
17044  char myBuffer[MY_BUFFER_SIZE];
17045  unsigned int count;
17046  unsigned int total;
17047  total = 0;
17048  do
17049  {
17050  count = DRV_USART_Read(myUSARTHandle, &myBuffer[total], MY_BUFFER_SIZE - total);
17051  if(count == DRV_USART_READ_ERROR)
17052  {
17053  // There was an error. The DRV_USART_ErrorGet() function
17054  // can be called to find the exact error.
17055  }
17056  total += count;
17057  // Do something else...
17058  } while( total < MY_BUFFER_SIZE );
17059  </code>
17060  Remarks:
17061  This function is thread safe in a RTOS application. If the driver is
17062  configured for polled operation, this it will not support blocking operation
17063  in a bare metal (non-RTOS) application.
17064 */
17065 
17066 size_t
17067  DRV_USART_Read (
17068  const DRV_HANDLE handle ,
17069  void * buffer ,
17070  const size_t numbytes ) ;
17071 // *****************************************************************************
17072 /* Function:
17073  size_t DRV_USART_Write
17074  (
17075  const DRV_HANDLE handle,
17076  void * buffer,
17077  const size_t numbytes
17078  )
17079  Summary:
17080  Writes data to the USART.
17081  <p><b>Implementation:</b> Static/Dynamic</p>
17082  Description:
17083  This routine writes data to the USART. This function is blocking if the
17084  driver was opened by the client for blocking operation. This function will
17085  not block if the driver was opened by the client for non blocking operation.
17086  If the ioIntent parameter at the time of opening the driver was
17087  DRV_IO_INTENT_BLOCKING, this function will only return when (or will block
17088  until) numbytes of bytes have been transmitted or if an error occurred. If
17089  there are buffers queued for writing, the function will wait until all the
17090  preceding buffers are completed. Ongoing buffer transmit operations will not
17091  be affected.
17092  If the ioIntent parameter at the time of opening the driver was
17093  DRV_IO_INTENT_NON_BLOCKING, this function will return with the number of
17094  bytes that were actually accepted for transmission. The function will not
17095  wait until numBytes of bytes have been transmitted. If there a buffers queued
17096  for transmit, the function will not wait and will return immediately with 0
17097  bytes.
17098  Precondition:
17099  The DRV_USART_Initialize routine must have been called for the specified
17100  USART driver instance.
17101  DRV_USART_Open must have been called to obtain a valid opened device handle.
17102  DRV_IO_INTENT_WRITE or DRV_IO_INTENT_READWRITE must have been specified in
17103  the DRV_USART_Open call.
17104  Parameters:
17105  handle - A valid open-instance handle, returned from the driver's
17106  open routine
17107  buffer - Buffer containing the data to written.
17108  numbytes - size of the buffer
17109  Returns:
17110  Number of bytes actually written to the driver. Return DRV_USART_WRITE_ERROR
17111  in case of an error.
17112  Example:
17113  <code>
17114  DRV_HANDLE myUSARTHandle; // Returned from DRV_USART_Open
17115  char myBuffer[MY_BUFFER_SIZE];
17116  int count;
17117  unsigned int total;
17118  total = 0;
17119  do
17120  {
17121  count = DRV_USART_Write(myUSARTHandle, &myBuffer[total],
17122  MY_BUFFER_SIZE - total);
17123  total += count;
17124  // Do something else...
17125  } while( total < MY_BUFFER_SIZE );
17126  </code>
17127  Remarks:
17128  This function is thread safe in a RTOS application. This function is thread
17129  safe in a RTOS application. If the driver is configured for polled
17130  operation, this it will not support blocking operation in a bare metal (non-RTOS)
17131  application.
17132 */
17133 
17134 size_t
17135  DRV_USART_Write (
17136  const DRV_HANDLE handle ,
17137  void * buffer ,
17138  const size_t numbytes ) ;
17139 // *****************************************************************************
17140 /* Function:
17141  DRV_USART_TRANSFER_STATUS DRV_USART_TransferStatus( const DRV_HANDLE handle )
17142  Summary:
17143  Returns the transmitter and receiver transfer status.
17144  <p><b>Implementation:</b> Static/Dynamic</p>
17145  Description:
17146  This returns the transmitter and receiver transfer status.
17147  Precondition:
17148  The DRV_USART_Initialize routine must have been called for the specified
17149  USART driver instance.
17150  DRV_USART_Open must have been called to obtain a valid opened device handle.
17151  Parameters:
17152  handle - A valid open-instance handle, returned from the driver's
17153  open routine
17154  Returns:
17155  A DRV_USART_TRANSFER_STATUS value describing the current status
17156  of the transfer.
17157  Example:
17158  <code>
17159  DRV_HANDLE myUSARTHandle; // Returned from DRV_USART_Open
17160  if (DRV_USART_TRANSFER_STATUS_RECEIVER_DATA_PRESENT & DRV_USART_TransferStatus(myUSARTHandle))
17161  {
17162  // Data has been received that can be read
17163  }
17164  </code>
17165  Remarks:
17166  The returned status may contain a value with more than one of the bits
17167  specified in the DRV_USART_TRANSFER_STATUS enumeration set. The caller
17168  should perform an "AND" with the bit of interest and verify if the result is
17169  non-zero (as shown in the example) to verify the desired status bit. This
17170  function is thread safe when called in a RTOS application.
17171 */
17172 
17175  const DRV_HANDLE handle ) ;
17176 // *****************************************************************************
17177 // *****************************************************************************
17178 // Section: USART Driver Byte Model Routines
17179 // *****************************************************************************
17180 // *****************************************************************************
17181 // *****************************************************************************
17182 /* Function:
17183  uint8_t DRV_USART_ReadByte( const DRV_HANDLE handle )
17184  Summary:
17185  Reads a byte of data from the USART.
17186  <p><b>Implementation:</b> Static/Dynamic</p>
17187  Description:
17188  This routine reads a byte of data from the USART.
17189  Precondition:
17190  The DRV_USART_Initialize routine must have been called for the specified
17191  USART driver instance.
17192  DRV_USART_Open must have been called to obtain a valid opened device handle.
17193  The transfer status should be checked to see if the receiver is not empty
17194  before calling this function.
17195  Parameters:
17196  handle - A valid open-instance handle, returned from the driver's
17197  open routine
17198  Returns:
17199  A data byte received by the driver.
17200  Example:
17201  <code>
17202  DRV_HANDLE myUSARTHandle; // Returned from DRV_USART_Open
17203  char myBuffer[MY_BUFFER_SIZE];
17204  unsigned int numBytes;
17205  numBytes = 0;
17206  do
17207  {
17208  if( DRV_USART_TRANSFER_STATUS_RECEIVER_DATA_PRESENT & DRV_USART_TransferStatus(myUSARTHandle) )
17209  {
17210  myBuffer[numBytes++] = DRV_USART_ReadByte(myUSARTHandle);
17211  }
17212  // Do something else...
17213  } while( numBytes < MY_BUFFER_SIZE);
17214  </code>
17215  Remarks:
17216  This function is thread safe when called in a RTOS application. Note that
17217  DRV_USART_WriteByte and DRV_USART_ReadByte function cannot co-exist with
17218  DRV_USART_BufferAddRead, DRV_USART_BufferAddWrite, DRV_USART_Read and
17219  DRV_USART_Write functions in a application. Calling the
17220  DRV_USART_ReadByte and DRV_USART_WriteByte functions will disrupt the
17221  processing of any queued buffers.
17222 */
17223 
17224 uint8_t
17226  const DRV_HANDLE handle ) ;
17227 // *****************************************************************************
17228 /* Function:
17229  void DRV_USART_WriteByte( const DRV_HANDLE handle, const uint8_t byte)
17230  Summary:
17231  Writes a byte of data to the USART.
17232  <p><b>Implementation:</b> Static/Dynamic</p>
17233  Description:
17234  This routine writes a byte of data to the USART.
17235  Precondition:
17236  The DRV_USART_Initialize routine must have been called for the specified
17237  USART driver instance.
17238  DRV_USART_Open must have been called to obtain a valid opened device handle.
17239  The transfer status should be checked to see if transmitter is not full
17240  before calling this function.
17241  Parameters:
17242  handle - A valid open-instance handle, returned from the driver's
17243  open routine
17244  byte - Data byte to write to the USART
17245  Returns:
17246  None.
17247  Example:
17248  <code>
17249  DRV_HANDLE myUSARTHandle; // Returned from DRV_USART_Open
17250  char myBuffer[MY_BUFFER_SIZE];
17251  unsigned int numBytes;
17252  // Preinitialize myBuffer with MY_BUFFER_SIZE bytes of valid data.
17253  numBytes = 0;
17254  while( numBytes < MY_BUFFER_SIZE );
17255  {
17256  if( !(DRV_USART_TRANSFER_STATUS_TRANSMIT_FULL & DRV_USART_TransferStatus(myUSARTHandle)) )
17257  {
17258  DRV_USART_WriteByte(myUSARTHandle, myBuffer[numBytes++]);
17259  }
17260  // Do something else...
17261  }
17262  </code>
17263  Remarks:
17264  This function is thread safe when called in a RTOS application. Note that
17265  DRV_USART_WriteByte and DRV_USART_ReadByte function cannot co-exist with
17266  DRV_USART_BufferAddRead, DRV_USART_BufferAddWrite, DRV_USART_Read and
17267  DRV_USART_Write functions in a application. Calling the
17268  DRV_USART_ReadByte and DRV_USART_WriteByte function will disrupt the
17269  processing of any queued buffers.
17270 */
17271 
17272 void
17274  const DRV_HANDLE handle ,
17275  const uint8_t byte ) ;
17276 // *****************************************************************************
17277 /* Function:
17278  unsigned int DRV_USART_ReceiverBufferSizeGet( const DRV_HANDLE handle )
17279  Summary:
17280  Returns the size of the receive buffer.
17281  <p><b>Implementation:</b> Static/Dynamic</p>
17282  Description:
17283  This routine returns the size of the receive buffer.
17284  Precondition:
17285  The DRV_USART_Initialize routine must have been called for the specified
17286  USART driver instance.
17287  DRV_USART_Open must have been called to obtain a valid opened device handle.
17288  Parameters:
17289  handle - A valid open-instance handle, returned from the driver's
17290  open routine
17291  Returns:
17292  Size of the driver's receive buffer, in bytes.
17293  Example:
17294  <code>
17295  DRV_HANDLE myUSARTHandle; // Returned from DRV_USART_Open
17296  const uint8_t readBuffer[5];
17297  unsigned int size, numBytes = 0;
17298  unsigned int readbufferLen = sizeof(readBuffer);
17299  size = DRV_USART_ReceiverBufferSizeGet(myUSARTHandle);
17300  // Do something based on the receiver buffer size
17301  </code>
17302  Remarks:
17303  Does not account for client queued buffers. This function is thread safe
17304  when called in a RTOS application.
17305 */
17306 
17307 unsigned int
17309  const DRV_HANDLE handle ) ;
17310 // *****************************************************************************
17311 /* Function:
17312  unsigned int DRV_USART_TransmitBufferSizeGet ( const DRV_HANDLE handle )
17313  Summary:
17314  Returns the size of the transmit buffer.
17315  <p><b>Implementation:</b> Static/Dynamic</p>
17316  Description:
17317  This routine returns the size of the transmit buffer and can be used by the
17318  application to determine the number of bytes to write with the
17319  DRV_USART_WriteByte function.
17320  Precondition:
17321  The DRV_USART_Initialize routine must have been called for the specified
17322  USART driver instance.
17323  DRV_USART_Open must have been called to obtain a valid opened device handle.
17324  Parameters:
17325  handle - A valid open-instance handle, returned from the driver's
17326  open routine
17327  Returns:
17328  Size of the driver's transmit buffer, in bytes.
17329  Examples:
17330  <code>
17331  DRV_HANDLE myUSARTHandle; // Returned from DRV_USART_Open
17332  const uint8_t writeBuffer[5];
17333  unsigned int size, numBytes = 0;
17334  unsigned int writeBufferLen = sizeof(writeBuffer);
17335  size = DRV_USART_TransmitBufferSizeGet (myUSARTHandle);
17336  // Do something based on the transmitter buffer size
17337  </code>
17338  Remarks:
17339  Does not account for client queued buffers. This function is thread safe
17340  when used in a RTOS application.
17341 */
17342 
17343 unsigned int
17345  const DRV_HANDLE handle ) ;
17346 // *****************************************************************************
17347 /* Function:
17348  bool DRV_USART_ReceiverBufferIsEmpty( const DRV_HANDLE handle )
17349  Summary:
17350  Provides the status of the driver's receive buffer.
17351  <p><b>Implementation:</b> Static/Dynamic</p>
17352  Description:
17353  This routine indicates if the driver's receiver buffer is empty. This
17354  function can be used in conjunction with the DRV_USART_Read and
17355  DRV_USART_ReadByte functions.
17356  Precondition:
17357  The DRV_USART_Initialize routine must have been called for the specified
17358  USART driver instance.
17359  DRV_USART_Open must have been called to obtain a valid opened device handle.
17360  Parameters:
17361  handle - A valid open-instance handle, returned from the driver's
17362  open routine
17363  Returns:
17364  true - if the driver's receive buffer is empty
17365  false - if the driver's receive buffer is not empty
17366  Example:
17367  <code>
17368  DRV_HANDLE myUSARTHandle; // Returned from DRV_USART_Open
17369  char myBuffer[MY_BUFFER_SIZE];
17370  unsigned int numBytes;
17371  numBytes = 0;
17372  while( numBytes < MY_BUFFER_SIZE );
17373  {
17374  if ( !DRV_USART_ReceiverBufferIsEmpty(myUSARTHandle) )
17375  {
17376  if( numBytes < MY_BUFFER_SIZE )
17377  {
17378  myBuffer[numBytes++] = DRV_USART_ReadByte (myUSARTHandle);
17379  }
17380  else
17381  {
17382  break;
17383  }
17384  }
17385  // Do something else while more data is received.
17386  }
17387  </code>
17388  Remarks:
17389  Does not account for client queued buffers. This function is safe thread
17390  safe when used in a RTOS application.
17391 */
17392 
17393 bool
17395  const DRV_HANDLE handle ) ;
17396 // *****************************************************************************
17397 /* Function:
17398  bool DRV_USART_TransmitBufferIsFull( const DRV_HANDLE handle )
17399  Summary:
17400  Provides the status of the driver's transmit buffer.
17401  <p><b>Implementation:</b> Static/Dynamic</p>
17402  Description:
17403  This routine identifies if the driver's transmit buffer is full or not. This
17404  function can be used in conjunction with the DRV_USART_Write and
17405  DRV_USART_WriteByte functions.
17406  Precondition:
17407  The DRV_USART_Initialize routine must have been called for the specified
17408  USART driver instance.
17409  DRV_USART_Open must have been called to obtain a valid opened device handle.
17410  Parameters:
17411  handle - A valid open-instance handle, returned from the driver's
17412  open routine
17413  Returns:
17414  true - if the transmit buffer is full
17415  false - if the transmit buffer is not full
17416  Example:
17417  <code>
17418  DRV_HANDLE myUSARTHandle; // Returned from DRV_USART_Open
17419  unsigned int numBytes;
17420  int bytesToWrite;
17421  const uint8_t writeBuffer[35] = "1234567890ABCDEFGHIJKLMNOP\n" ;
17422  int writebufferLen = strlen((char *)writeBuffer);
17423  numBytes = 0;
17424  while( numBytes < writebufferLen )
17425  {
17426  if (DRV_USART_TransmitBufferisFull())
17427  {
17428  // Do something else until there is some room in the driver's Transmit buffer.
17429  }
17430  else
17431  {
17432  DRV_USART_WriteByte(myUSARTHandle, writeBuffer[numBytes++]);
17433  }
17434  }
17435  </code>
17436  Remarks:
17437  Does not account for client queued buffers. This function is thread safe
17438  when called in a RTOS application.
17439 */
17440 
17441 bool
17443  const DRV_HANDLE handle ) ;
17444 // *****************************************************************************
17445 /* Function:
17446  void DRV_USART_ByteTransmitCallbackSet
17447  (
17448  const SYS_MODULE_INDEX index,
17449  const DRV_USART_BYTE_EVENT_HANDLER eventHandler
17450  )
17451  Summary:
17452  Registers a callback function for byte transmit event.
17453  Description:
17454  This function allows a transmit callback function to be registered with the
17455  driver. The callback function is invoked when a byte has been transmitted
17456  using DRV_USART_WriteByte () function.
17457  The callback function should be registered with the driver prior to any
17458  writes to the driver. The callback functionality is available only in the
17459  interrupt mode of operation. The driver clears the interrupt after invoking
17460  the callback function.
17461  Precondition:
17462  The DRV_USART_Initialize routine must have been called for the specified
17463  USART driver instance.
17464  Parameters:
17465  index - Identifier for the object instance to be opened
17466  eventHandler - Pointer to the event handler function.
17467  Returns:
17468  None.
17469  Example:
17470  <code>
17471  // myAppObj is an application specific state data object.
17472  MY_APP_OBJ myAppObj;
17473  uint8_t mybuffer[MY_BUFFER_SIZE];
17474  // myUSARTHandle is the handle returned by the DRV_USART_Open function.
17475  myUSARTHandle = DRV_USART_Open(DRV_USART_INDEX_0, DRV_IO_INTENT_EXCLUSIVE);
17476  (uintptr_t)&myAppObj );
17477  // Register an event handler with driver. This is done once
17478  DRV_USART_ByteTransmitCallbackSet (DRV_USART_INDEX_0, APP_USARTTransmitEventHandler);
17479  DRV_USART_WriteByte (myUSARThandle, myBuffer[0]);
17480  // Event Processing Technique. Event is received when
17481  // the byte is transmitted.
17482  void APP_USARTTransmitEventHandler (const SYS_MODULE_INDEX index)
17483  {
17484  // Byte has been transmitted. Handle the event.
17485  }
17486  </code>
17487  Remarks:
17488  None
17489 */
17490 
17491 void
17493  const SYS_MODULE_INDEX index ,
17494  const DRV_USART_BYTE_EVENT_HANDLER eventHandler ) ;
17495 // *****************************************************************************
17496 /* Function:
17497  void DRV_USART_ByteReceiveCallbackSet
17498  (
17499  const SYS_MODULE_INDEX index,
17500  const DRV_USART_BYTE_EVENT_HANDLER eventHandler
17501  )
17502  Summary:
17503  Registers receive callback function for byte receive event.
17504  Description:
17505  This function allows a receive callback function to be registered with the
17506  driver. The callback function is invoked when a byte has been received. The
17507  received byte can then be read using DRV_USART_ReadByte() function.
17508  The callback function should be registered with the driver as part of the
17509  initialization. The callback functionality is available only in the
17510  interrupt mode of operation. The driver clears the interrupt after invoking
17511  the callback function.
17512  Precondition:
17513  The DRV_USART_Initialize routine must have been called for the specified
17514  USART driver instance.
17515  Parameters:
17516  index - Identifier for the object instance to be opened
17517  eventHandler - Pointer to the event handler function.
17518  Returns:
17519  None.
17520  Example:
17521  <code>
17522  // myAppObj is an application specific state data object.
17523  MY_APP_OBJ myAppObj;
17524  uint8_t mybuffer[MY_BUFFER_SIZE];
17525  // myUSARTHandle is the handle returned by the DRV_USART_Open function.
17526  myUSARTHandle = DRV_USART_Open(DRV_USART_INDEX_0, DRV_IO_INTENT_EXCLUSIVE);
17527  (uintptr_t)&myAppObj );
17528  // Register an event handler with driver. This is done once
17529  DRV_USART_ByteReceiveCallbackSet(DRV_USART_INDEX_0, APP_USARTReceiveEventHandler);
17530  // Event Processing Technique. Event is received when
17531  // a byte is received.
17532  void APP_USARTReceiveEventHandler(const SYS_MODULE_INDEX index)
17533  {
17534  // Byte has been Received. Handle the event.
17535  // Read byte using DRV_USART_ReadByte ()
17536  // DRV_USART_ReceiverBufferIsEmpty() function can be used to
17537  // check if the receiver buffer is empty.
17538  }
17539  </code>
17540  Remarks:
17541  None
17542 */
17543 
17544 void
17546  const SYS_MODULE_INDEX index ,
17547  const DRV_USART_BYTE_EVENT_HANDLER eventHandler ) ;
17548 // *****************************************************************************
17549 /* Function:
17550  void DRV_USART_ByteErrorCallbackSet
17551  (
17552  const SYS_MODULE_INDEX index,
17553  const DRV_USART_BYTE_EVENT_HANDLER eventHandler
17554  )
17555  Summary:
17556  Registers callback to handle for byte error events.
17557  Description:
17558  This function allows a callback function to be registered with the driver
17559  to handle the error events occurring in the transmit/receive path during
17560  byte transfers.
17561  The callback function should be registered as part of the initialization.
17562  The callback functionality is available only in the interrupt mode of
17563  operation. The driver clears the interrupt after invoking the callback
17564  function.
17565  Precondition:
17566  The DRV_USART_Initialize routine must have been called for the specified
17567  USART driver instance.
17568  Parameters:
17569  index - Identifier for the object instance to be opened
17570  eventHandler - Pointer to the event handler function.
17571  Returns:
17572  None.
17573  Example:
17574  <code>
17575  // myAppObj is an application specific state data object.
17576  MY_APP_OBJ myAppObj;
17577  uint8_t mybuffer[MY_BUFFER_SIZE];
17578  // myUSARTHandle is the handle returned by the DRV_USART_Open function.
17579  myUSARTHandle = DRV_USART_Open(DRV_USART_INDEX_0, DRV_IO_INTENT_EXCLUSIVE);
17580  (uintptr_t)&myAppObj );
17581  // Register an event handler with driver. This is done once
17582  DRV_USART_ByteErrorCallbackSet (DRV_USART_INDEX_0, APP_USARTErrorEventHandler);
17583  // Event Processing Technique.
17584  void APP_USARTErrorEventHandler(const SYS_MODULE_INDEX index)
17585  {
17586  // Error has occurred. Handle the event.
17587  }
17588  </code>
17589  Remarks:
17590  None
17591 */
17592 
17593 void
17595  const SYS_MODULE_INDEX index ,
17596  const DRV_USART_BYTE_EVENT_HANDLER eventHandler ) ;
17597 // *****************************************************************************
17598 // *****************************************************************************
17599 // Section: USART Driver Setup and Status Routines
17600 // *****************************************************************************
17601 // *****************************************************************************
17602 // *****************************************************************************
17603 /* Function:
17604  DRV_USART_ERROR DRV_USART_ErrorGet(DRV_HANDLE client);
17605  Summary:
17606  This function returns the error(if any) associated with the last client
17607  request.
17608  <p><b>Implementation:</b> Static/Dynamic</p>
17609  Description:
17610  This function returns the error(if any) associated with the last client
17611  request. DRV_USART_Read and DRV_USART_Write will update the client
17612  error status when these functions return DRV_USART_TRANSFER_ERROR. If the
17613  driver send a DRV_USART_BUFFER_EVENT_ERROR to the client, the client can
17614  call this function to know the error cause. The error status will be updated
17615  on every operation and should be read frequently (ideally immediately after
17616  the driver operation has completed) to know the relevant error status.
17617  Precondition:
17618  The DRV_USART_Initialize routine must have been called for the specified
17619  USART driver instance.
17620  DRV_USART_Open must have been called to obtain a valid opened device handle.
17621  Parameters:
17622  bufferhandle - Handle of the buffer of which the processed number of bytes
17623  to be obtained.
17624  Returns:
17625  A DRV_USART_ERROR type indicating last known error status.
17626  Example:
17627  <code>
17628  // myAppObj is an application specific object.
17629  MY_APP_OBJ myAppObj;
17630  uint8_t mybuffer[MY_BUFFER_SIZE];
17631  DRV_USART_BUFFER_HANDLE bufferHandle;
17632  // myUSARTHandle is the handle returned
17633  // by the DRV_USART_Open function.
17634  // Client registers an event handler with driver. This is done once.
17635  DRV_USART_BufferEventHandlerSet( myUSARTHandle, APP_USARTBufferEventHandle,
17636  (uintptr_t)&myAppObj );
17637  bufferHandle = DRV_USART_BufferAddRead( myUSARThandle,
17638  myBuffer, MY_BUFFER_SIZE );
17639  if(DRV_USART_BUFFER_HANDLE_INVALID == bufferHandle)
17640  {
17641  // Error handling here
17642  }
17643  // Event Processing Technique. Event is received when
17644  // the buffer is processed.
17645  void APP_USARTBufferEventHandler( DRV_USART_BUFFER_EVENT event,
17646  DRV_USART_BUFFER_HANDLE bufferHandle, uintptr_t contextHandle )
17647  {
17648  // The context handle was set to an application specific
17649  // object. It is now retrievable easily in the event handler.
17650  MY_APP_OBJ myAppObj = (MY_APP_OBJ *) contextHandle;
17651  size_t processedBytes;
17652  switch(event)
17653  {
17654  case DRV_USART_BUFFER_EVENT_COMPLETE:
17655  // This means the data was transferred.
17656  break;
17657  case DRV_USART_BUFFER_EVENT_ERROR:
17658  // Error handling here.
17659  // We can find out how many bytes were processed in this
17660  // buffer before the error occurred. We can also find
17661  // the error cause.
17662  processedBytes = DRV_USART_BufferCompletedBytesGet(bufferHandle);
17663  if(DRV_USART_ERROR_RECEIVE_OVERRUN == DRV_USART_ErrorGet(myUSARTHandle))
17664  {
17665  // There was an receive over flow error.
17666  // Do error handling here.
17667  }
17668  break;
17669  default:
17670  break;
17671  }
17672  }
17673  </code>
17674  Remarks:
17675  It is the client's responsibility to make sure that the error status is
17676  obtained frequently. The driver will update the client error status
17677  regardless of whether this has been examined by the client. This function
17678  is thread safe when used in a RTOS application.
17679 */
17680 
17683  const DRV_HANDLE client ) ;
17684 // *****************************************************************************
17685 /* Function:
17686  void DRV_USART_BaudSet(DRV_HANDLE client, uint32_t baud);
17687  Summary:
17688  This function changes the USART module baud to the specified value.
17689  <p><b>Implementation:</b> Static/Dynamic</p>
17690  Description:
17691  This function changes the USART module baud to the specified value. Any
17692  queued buffer requests will be processed at the updated baud. The USART
17693  driver operates at the baud specified in DRV_USART_Initialize function
17694  unless the DRV_USART_BaudSet function is called to change the baud.
17695  Precondition:
17696  The DRV_USART_Initialize routine must have been called for the specified
17697  USART driver instance.
17698  DRV_USART_Open must have been called to obtain a valid opened device handle.
17699  Parameters:
17700  handle - client handle returned by DRV_USART_Open function.
17701  baud - desired baud.
17702  Returns:
17703  None.
17704  Example:
17705  <code>
17706  // myUSARTHandle is the handle returned
17707  // by the DRV_USART_Open function.
17708  DRV_USART_BaudSet(myUSARTHandle, 9600);
17709  </code>
17710  Remarks:
17711  The implementation of this function, in this release of the driver, changes
17712  the baud immediately. This may interrupt on-going data transfer. It is
17713  recommended that the driver be opened exclusively if this function is to be
17714  called. This function is thread safe when used in a RTOS application.
17715 */
17716 
17719  const DRV_HANDLE client ,
17720  uint32_t baud ) ;
17721 // *****************************************************************************
17722 /* Function:
17723  void DRV_USART_LineControlSet
17724  (
17725  DRV_HANDLE client,
17726  DRV_USART_LINE_CONTROL lineControl
17727  );
17728  Summary:
17729  This function changes the USART module line control to the specified value.
17730  <p><b>Implementation:</b> Static/Dynamic</p>
17731  Description:
17732  This function changes the USART module line control parameters to the
17733  specified value. Any queued buffer requests will be processed at the
17734  updated line control parameters. The USART driver operates at the line
17735  control parameters specified in DRV_USART_Initialize function unless the
17736  DRV_USART_LineControlSet function is called to change the line control
17737  parameters.
17738  Precondition:
17739  The DRV_USART_Initialize routine must have been called for the specified
17740  USART driver instance.
17741  DRV_USART_Open must have been called to obtain a valid opened device handle.
17742  Parameters:
17743  handle - client handle returned by DRV_USART_Open function.
17744  lineControl - line control parameters.
17745  Returns:
17746  DRV_USART_LINE_CONTROL_SET_SUCCESS if the function was successful. Returns
17747  DRV_HANDLE_INVALID if the client handle is not valid.
17748  Example:
17749  <code>
17750  // myUSARTHandle is the handle returned
17751  // by the DRV_USART_Open function.
17752  DRV_USART_LineControlSet(myUSARTHandle, DRV_USART_LINE_CONTROL_8NONE1);
17753  </code>
17754  Remarks:
17755  The implementation of this function, in this release of the driver, changes
17756  the line control immediately. This may interrupt on-going data transfer. It
17757  is recommended that the driver be opened exclusively if this function is to
17758  be called. This function is thread safe when called in a RTOS application.
17759 */
17760 
17763  const DRV_HANDLE client ,
17764  const DRV_USART_LINE_CONTROL lineControl ) ;
17765 //DOM-IGNORE-BEGIN
17766 //DOM-IGNORE-END
17767  // #ifndef _DRV_USART_H
17768 /*******************************************************************************
17769  End of File
17770 */
17771 
17772 #endif /*00 C:\microchip\harmony\v2_06\framework\driver\usart\drv_usart.h*/
17773 /* CLOSE_FILE Include File */
17774 
17775 /* OPEN FILE C:\microchip\harmony\v2_06\framework\driver\usart\src\drv_usart_variant_mapping.h */
17776 /*******************************************************************************
17777  USART Driver Variant Mapping
17778  Company:
17779  Microchip Technology Inc.
17780  File Name:
17781  drv_usart_variant_mapping.h
17782  Summary:
17783  USART Driver Variant Mapping
17784  Description:
17785  This file provides feature and build variant mapping macros allowing the
17786  driver to easily be built with different implementation variations based
17787  on static build-time configuration selections.
17788 *******************************************************************************/
17789 //DOM-IGNORE-BEGIN
17790 /*******************************************************************************
17791 Copyright (c) 2012 released Microchip Technology Inc. All rights reserved.
17792 Microchip licenses to you the right to use, modify, copy and distribute
17793 Software only when embedded on a Microchip microcontroller or digital signal
17794 controller that is integrated into your product or third party product
17795 (pursuant to the sublicense terms in the accompanying license agreement).
17796 You should refer to the license agreement accompanying this Software for
17797 additional information regarding your rights and obligations.
17798 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
17799 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
17800 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
17801 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
17802 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
17803 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
17804 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
17805 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
17806 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
17807 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
17808 *******************************************************************************/
17809 //DOM-IGNORE-END
17810 #ifndef _DRV_USART_FEATURE_MAPPING_H
17811 #define _DRV_USART_FEATURE_MAPPING_H
17812 // *****************************************************************************
17813 // *****************************************************************************
17814 // Section: Interrrupt Variations
17815 // *****************************************************************************
17816 // *****************************************************************************
17817 /* Mapping of the interrupt mode variations
17818 */
17819  /* Driver is configured for polled mode */
17820 #define _DRV_USART_InterruptSourceIsEnabled( source ) false
17821 #define _DRV_USART_InterruptSourceEnable( source )
17822 #define _DRV_USART_InterruptSourceDisable( source ) false
17823 #define _DRV_USART_InterruptSourceStatusClear( source ) SYS_INT_SourceStatusClear ( source )
17824 #define _DRV_USART_SEM_POST( x ) OSAL_SEM_Post ( x )
17825 #define _DRV_USART_TAKE_MUTEX( x , y ) OSAL_MUTEX_Lock ( x , y )
17826 #define _DRV_USART_RELEASE_MUTEX( x ) OSAL_MUTEX_Unlock ( x )
17827 #define _SYS_DMA_ChannelForceStart( channelHandle ) SYS_DMA_ChannelForceStart ( channelHandle )
17828  /* This means the driver is being built in a baremetal application.
17829  We cannot let a client open the driver in blocking mode */
17830 #define _DRV_USART_ALWAYS_NON_BLOCKING ( DRV_IO_INTENT_NONBLOCKING )
17831 // *****************************************************************************
17832 // *****************************************************************************
17833 // Section: Buffer Queue support
17834 // *****************************************************************************
17835 // *****************************************************************************
17836 /* Mapping of macros for buffer queue support
17837 */
17838  /* We dont need buffer queues or byte model support */
17839 #define _DRV_USART_TRANSMIT_BUFFER_QUEUE_TASKS( x ) _DRV_USART_ByteTransmitTasks ( x )
17840 #define _DRV_USART_RECEIVE_BUFFER_QUEUE_TASKS( x ) _DRV_USART_ByteReceiveTasks ( x )
17841 #define _DRV_USART_ERROR_TASKS( x ) _DRV_USART_ByteErrorTasks ( x )
17842 #define _DRV_USART_CLIENT_BUFFER_QUEUE_OBJECTS_REMOVE( x ) true
17843 #define _DRV_USART_ByteModelInterruptSourceEnable( source )
17844 // *****************************************************************************
17845 // *****************************************************************************
17846 // Initializtion Parameter Static Overrides
17847 // *****************************************************************************
17848 // *****************************************************************************
17849  //_DRV_USART_FEATURE_MAPPING_H
17850 /*******************************************************************************
17851  End of File
17852 */
17853 #endif /*00 C:\microchip\harmony\v2_06\framework\driver\usart\src\drv_usart_variant_mapping.h*/
17854 /* CLOSE_FILE Include File */
17855 
17856 #include "system/clk/sys_clk.h"
17857 #include "system/int/sys_int.h"
17858 /* OPEN FILE C:\microchip\harmony\v2_06\framework\system\debug\sys_debug.h */
17859 /*******************************************************************************
17860  Debug System Services Library Header
17861  Company:
17862  Microchip Technology Inc.
17863 
17864  File Name:
17865  sys_debug.h
17866  Summary:
17867  Defines the common debug definitions and interfaces used by MPLAB Harmony
17868  libraries to report errors and debug information to the user.
17869  Description:
17870  This header file defines the common debug definitions and interface macros
17871  (summary below) and prototypes used by MPLAB Harmony libraries to report
17872  errors and debug information to the user.
17873  *******************************************************************************/
17874 //DOM-IGNORE-BEGIN
17875 /*******************************************************************************
17876 Copyright (c) 2013-2015 released Microchip Technology Inc. All rights reserved.
17877 Microchip licenses to you the right to use, modify, copy and distribute
17878 Software only when embedded on a Microchip microcontroller or digital signal
17879 controller that is integrated into your product or third party product
17880 (pursuant to the sublicense terms in the accompanying license agreement).
17881 You should refer to the license agreement accompanying this Software for
17882 additional information regarding your rights and obligations.
17883 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
17884 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
17885 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
17886 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
17887 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
17888 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
17889 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
17890 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
17891 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
17892 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
17893  *******************************************************************************/
17894 //DOM-IGNORE-END
17895 #ifndef _SYS_DEBUG_H
17896 #define _SYS_DEBUG_H
17897 #include "C:\microchip\harmony\v2_06\framework\system\system.h"
17898  /* LDRA full path */
17899 // This should be defined in system_config.h. It is added here as a build safe-guard.
17900 #define SYS_DEBUG_BUFFER_DMA_READY
17901 // *****************************************************************************
17902 // *****************************************************************************
17903 // Section: SYS DEBUG Data Types
17904 // *****************************************************************************
17905 // *****************************************************************************
17906 // *****************************************************************************
17907 /* SYS_ERROR_LEVEL enumeration
17908  Summary:
17909  System error message priority levels.
17910  Description:
17911  This enumeration defines the supported system error message priority values.
17912  Remarks:
17913  Used by debug message macros to compare individual message priority against
17914  a global system-wide error message priority level to determine if an
17915  individual message should be displayed.
17916 */
17917 
17918 typedef
17919  enum
17920  {
17921  /* Errors that have the potential to cause a system crash. */
17923  /* Errors that have the potential to cause incorrect behavior. */
17925  /* Warnings about potentially unexpected behavior or side effects. */
17927  /* Information helpful to understanding potential errors and warnings. */
17929  /* Verbose information helpful during debugging and testing. */
17931  } SYS_ERROR_LEVEL ;
17932 // DOM-IGNORE-BEGIN
17933 // *****************************************************************************
17934 /* Do not use this variable directly. Use SYS_DEBUG_ErrorLevelGet or
17935  SYS_DEBUG_ErrorLevelSet functions to access this value.
17936 */
17937 
17938 extern SYS_ERROR_LEVEL
17939  gblErrLvl ;
17940 // DOM-IGNORE-END
17941 // *****************************************************************************
17942 /* SYS Debug Module Index Number
17943  Summary:
17944  Debug System Service index.
17945  Description:
17946  This constant defines a symbolic name for the debug system service index.
17947  Remarks:
17948  There can only be a single debug system service instance in the system.
17949 */
17950 #define SYS_DEBUG_INDEX_0 0
17951 // *****************************************************************************
17952 /* SYS Debug Initialize structure
17953  Summary:
17954  Defines the data required to initialize the debug system service.
17955  Description:
17956  This structure defines the data required to initialize the debug system
17957  service.
17958  Remarks:
17959  None.
17960 */
17961 
17962 typedef
17963  struct
17964  {
17965  /* System module initialization */
17966  SYS_MODULE_INIT moduleInit ;
17967  /* Initial system error level setting. */
17968  SYS_ERROR_LEVEL errorLevel ;
17969  /* Console index to receive debug messages */
17970  SYS_MODULE_INDEX consoleIndex ;
17971  } SYS_DEBUG_INIT ;
17972 // *****************************************************************************
17973 // *****************************************************************************
17974 // Section: SYS DEBUG Functions
17975 // *****************************************************************************
17976 // *****************************************************************************
17977 // *****************************************************************************
17978 /* Function:
17979  SYS_MODULE_OBJ SYS_DEBUG_Initialize( const SYS_MODULE_INDEX index,
17980  const SYS_MODULE_INIT * const init )
17981  Summary:
17982  Initializes the global error level and specific module instance.
17983  Description:
17984  This function initializes the global error level. It also initializes any
17985  internal system debug module data structures.
17986  Precondition:
17987  None.
17988  Parameters:
17989  index - Index for the instance to be initialized
17990  init - Pointer to a data structure containing any data necessary
17991  to initialize the debug service. This pointer may be null
17992  if no data is required because static overrides have
17993  been provided.
17994  Returns:
17995  If successful, returns a valid handle to an object. Otherwise, it
17996  returns SYS_MODULE_OBJ_INVALID.
17997  Example:
17998  <code>
17999  SYS_MODULE_OBJ objectHandle;
18000  SYS_DEBUG_INIT debugInit =
18001  {
18002  .moduleInit = {0},
18003  .errorLevel = SYS_ERROR_DEBUG,
18004  };
18005  objectHandle = SYS_Debug_Initialize (SYS_DEBUG_CONSOLE, (SYS_MODULE_INIT*)&debugInit);
18006  if (SYS_MODULE_OBJ_INVALID == objectHandle)
18007  {
18008  // Handle error
18009  }
18010  </code>
18011  Remarks:
18012  This routine should only be called once during system initialization. If the
18013  system was already initialized it safely returns without causing any disturbance.
18014 */
18015 
18016 SYS_MODULE_OBJ
18018  const SYS_MODULE_INDEX index ,
18019  const SYS_MODULE_INIT * const init ) ;
18020 // *****************************************************************************
18021 /* Function:
18022  void SYS_DEBUG_Reinitialize( SYS_MODULE_OBJ object,
18023  const SYS_MODULE_INIT * const init )
18024  Summary:
18025  Reinitializes and refreshes the data structure for the instance of the
18026  Debug module.
18027  Description:
18028  This function reinitializes and refreshes the data structure for the instance
18029  of the Debug module using the supplied data.
18030  Precondition:
18031  The SYS_DEBUG_Initialize function should have been called before calling
18032  this function.
18033  Parameters:
18034  object - Identifies the SYS DEBUG Object returned by the Initialize
18035  interface
18036  init - Pointer to the data structure containing any data
18037  necessary to initialize the hardware
18038  Returns:
18039  None
18040  Example:
18041  <code>
18042  SYS_MODULE_OBJ objectHandle;
18043  // Populate the console initialization structure
18044  SYS_DEBUG_INIT dbgInit =
18045  {
18046  .moduleInit = {0},
18047  .errorLevel = SYS_ERROR_DEBUG,
18048  };
18049  SYS_DEBUG_Reinitialize (objectHandle, (SYS_MODULE_INIT*)&dbgInit);
18050  </code>
18051  Remarks:
18052  This operation uses the same initialization data structure as the
18053  SYS_DEBUG_Initialize operation. This function can be called multiple times
18054  to reinitialize the module.
18055 */
18056 
18057 void
18059  SYS_MODULE_OBJ object ,
18060  const SYS_MODULE_INIT * const init ) ;
18061 // *****************************************************************************
18062 /* Function:
18063  void SYS_DEBUG_Deinitialize( SYS_MODULE_OBJ object )
18064  Summary:
18065  Deinitializes the specific module instance of the Debug module.
18066  Description:
18067  This function deinitializes the specific module instance disabling its
18068  operation (and any hardware for driver modules). Resets all of the internal
18069  data structures and fields for the specified instance to the default settings.
18070  Precondition:
18071  The SYS_DEBUG_Initialize function should have been called before calling
18072  this function.
18073  Parameters:
18074  object - SYS DEBUG object handle, returned from SYS_DEBUG_Initialize
18075  Returns:
18076  None.
18077  Example:
18078  <code>
18079  SYS_MODULE_OBJ object; // Returned from SYS_DEBUG_Initialize
18080  SYS_DEBUG_Deinitialize (object);
18081  </code>
18082  Remarks:
18083  Once the Initialize operation has been called, the Deinitialize
18084  operation must be called before the Initialize operation can be called
18085  again.
18086 */
18087 
18088 void
18090  SYS_MODULE_OBJ object ) ;
18091 // *****************************************************************************
18092 /* Function:
18093  void SYS_DEBUG_Tasks( SYS_MODULE_OBJ object )
18094  Summary:
18095  Maintains the debug module's state machine.
18096  Description:
18097  This function is used to maintain the debug module's internal state
18098  machine and implement its ISR for interrupt-driven implementations.
18099  Precondition:
18100  The SYS_DEBUG_Initialize function must have been called for the specified
18101  CONSOLE driver instance.
18102  Parameters:
18103  object - SYS DEBUG object handle, returned from SYS_DEBUG_Initialize
18104  Returns:
18105  None.
18106  Example:
18107  <code>
18108  SYS_MODULE_OBJ object; // Returned from SYS_DEBUG_Initialize
18109  while (true)
18110  {
18111  SYS_DEBUG_Tasks (object);
18112  // Do other tasks
18113  }
18114  </code>
18115  Remarks:
18116  This function is normally not called directly by an application. It is
18117  called by the system's Tasks routine (SYS_Tasks) or by the appropriate raw
18118  ISR.
18119 */
18120 
18121 void
18122  SYS_DEBUG_Tasks (
18123  SYS_MODULE_OBJ object ) ;
18124 // *****************************************************************************
18125 /* Function:
18126  SYS_STATUS SYS_DEBUG_Status( SYS_MODULE_OBJ object )
18127  Summary:
18128  Returns status of the specific instance of the debug service module.
18129  Description:
18130  This function returns the status of the specific debug service module
18131  instance.
18132  Precondition:
18133  The SYS_CONSOLE_Initialize function should have been called before calling
18134  this function.
18135  Parameters:
18136  object - Debug module object handle, returned from SYS_DEBUG_Initialize
18137  Returns:
18138  * SYS_STATUS_READY - Indicates that the module is running and
18139  ready to service requests. Any value greater
18140  than SYS_STATUS_READY is also a normal
18141  running state in which the module is ready
18142  to accept new operations.
18143  * SYS_STATUS_BUSY - Indicates that the module is busy with a
18144  previous system level operation and cannot
18145  start another.
18146  * SYS_STATUS_ERROR - Indicates that the module is in an error
18147  state. Any value less than SYS_STATUS_ERROR
18148  is also an error state.
18149  * SYS_STATUS_UNINITIALIZED - Indicates that the module has not been
18150  initialized or has been deinitialized.
18151  Example:
18152  <code>
18153  SYS_MODULE_OBJ object; // Returned from SYS_CONSOLE_Initialize
18154  SYS_STATUS debugStatus;
18155  debugStatus = SYS_DEBUG_Status (object);
18156  if (SYS_STATUS_ERROR >= debugStatus)
18157  {
18158  // Handle error
18159  }
18160  </code>
18161  Remarks:
18162  None.
18163 */
18164 
18165 SYS_STATUS
18167  SYS_MODULE_OBJ object ) ;
18168 // *****************************************************************************
18169 // *****************************************************************************
18170 // Section: SYS DEBUG Console Functions
18171 // *****************************************************************************
18172 // *****************************************************************************
18173 // *****************************************************************************
18174 /* Function:
18175  SYS_DEBUG_Message( const char* message );
18176  Summary:
18177  Prints a message to the console regardless of the system error level.
18178  Description:
18179  This function prints a message to the console regardless of the system
18180  error level. It can be used as an implementation of the SYS_MESSAGE and
18181  SYS_DEBUG_MESSAGE macros.
18182  Precondition:
18183  SYS_DEBUG_Initialize must have returned a valid object handle and the
18184  SYS_DEBUG_Tasks function must be called by the system to complete the
18185  message request.
18186  Parameters:
18187  message - Pointer to a message string to be displayed.
18188  Returns:
18189  None.
18190  Example:
18191  <code>
18192  // In system_config.h:
18193 #define SYS_MESSAGE(message) SYS_DEBUG_Message(message)
18194 
18195  // In source (.c) files:
18196  SYS_MESSAGE("My Message\n\r");
18197  </code>
18198  Remarks:
18199  Do not call this function directly. Call the SYS_MESSAGE or
18200  SYS_DEBUG_MESSAGE macros instead.
18201 
18202  The default SYS_MESSAGE and SYS_DEBUG_MESSAGE macro definitions remove
18203  the messages and message function calls from the source code. To access
18204  and utilize the messages, define the SYS_DEBUG_USE_CONSOLE macro or
18205  override the definitions of the individual macros.
18206 */
18207 
18208 void
18210  const char * message ) ;
18211 // *****************************************************************************
18212 /* Function:
18213  SYS_DEBUG_Print( const char* format, ... )
18214  Summary:
18215  Formats and prints a message with a variable number of arguments to the
18216  console regardless of the system error level.
18217  Description:
18218  This function formats and prints a message with a variable number of
18219  arguments to the console regardless of the system error level. It can be
18220  used to implement the SYS_PRINT and SYS_DEBUG_PRINT macros.
18221  Precondition:
18222  SYS_DEBUG_Initialize must have returned a valid object handle and the
18223  SYS_DEBUG_Tasks function must be called by the system to complete the
18224  message request.
18225  Parameters:
18226  format - Pointer to a buffer containing the format string for
18227  the message to be displayed.
18228  ... - Zero or more optional parameters to be formated as
18229  defined by the format string.
18230  Returns:
18231  None.
18232  Example:
18233  <code>
18234  // In system_config.h
18235 #define SYS_PRINT(format, ...) SYS_DEBUG_Print(format, ##__VA_ARG__)
18236 
18237  // In source code
18238  int result;
18239 
18240  result = SomeOperation();
18241  if (result > MAX_VALUE)
18242  {
18243  SYS_PRINT("Result of %d exceeds max value\r\n", result);
18244  }
18245  </code>
18246  Remarks:
18247  The format string and arguments follow the printf convention.
18248 
18249  Do not call this function directly. Call the SYS_PRINT or SYS_DEBUG_PRINT
18250  macros instead.
18251 
18252  The default SYS_PRINT and SYS_DEBUG_PRINT macro definitions remove the
18253  messages and message function calls. To access and utilize the messages,
18254  define the SYS_DEBUG_USE_CONSOLE macro or override the definitions of the
18255  individual macros.
18256 */
18257 
18258 void
18259  SYS_DEBUG_Print (
18260  const char * format ,
18261  ... ) ;
18262 // *****************************************************************************
18263 /* Function:
18264  void SYS_DEBUG_ErrorLevelSet(SYS_ERROR_LEVEL level);
18265  Summary:
18266  Sets the global system error reporting level.
18267  Description:
18268  This function sets the global system error reporting level.
18269 
18270  Precondition:
18271  SYS_DEBUG_Initialize must have returned a valid object handle.
18272  Parameters:
18273  level - The desired system error level.
18274  Returns:
18275  None.
18276  Example:
18277  <code>
18278  SYS_DEBUG_ErrorLevelSet(SYS_ERROR_WARNING);
18279  </code>
18280  Remarks:
18281  None.
18282 */
18283 
18284 void
18286  SYS_ERROR_LEVEL level ) ;
18287 // *****************************************************************************
18288 /* Function:
18289  SYS_ERROR_LEVEL SYS_DEBUG_ErrorLevelGet(void);
18290  Summary:
18291  Returns the global system Error reporting level.
18292  Description:
18293  This function returns the global System Error reporting level.
18294 
18295  Precondition:
18296  SYS_DEBUG_Initialize must have returned a valid object handle.
18297  Parameters:
18298  None.
18299  Returns:
18300  The global System Error Level.
18301  Example:
18302  <code>
18303  SYS_ERROR_LEVEL level;
18304 
18305  level = SYS_DEBUG_ErrorLevelGet();
18306  </code>
18307  Remarks:
18308  None.
18309 */
18310 
18312  SYS_DEBUG_ErrorLevelGet ( void ) ;
18313 // *****************************************************************************
18314 // *****************************************************************************
18315 // Section: SYS DEBUG Macros
18316 // *****************************************************************************
18317 // *****************************************************************************
18318 // *****************************************************************************
18319 /* Macro:
18320  _SYS_DEBUG_MESSAGE( SYS_ERROR_LEVEL level, const char* message )
18321  Summary:
18322  Prints a debug message if the specified level is at or below the global
18323  system error level.
18324  Description:
18325  This macro prints a debug message if the specified level is at or below the
18326  global error level. It can be used to implement the SYS_DEBUG_MESSAGE macro.
18327  Precondition:
18328  SYS_DEBUG_Initialize must have returned a valid object handle.
18329  Parameters:
18330  level - The current error level threshold for displaying the message.
18331  message - Pointer to a buffer containing the message to be displayed.
18332  Returns:
18333  None.
18334  Example:
18335  <code>
18336  // In system_config.h
18337 #define SYS_DEBUG_MESSAGE(level,message) _SYS_DEBUG_MESSAGE(level,message)
18338 
18339  // In library source (.c) code.
18340  SYS_DEBUG_MESSAGE(SYS_ERROR_WARNING, "My debug warning message\n\r");
18341  </code>
18342  Remarks:
18343  Do not call this macro directly. Call the SYS_DEBUG_MESSAGE macro instead.
18344 
18345  The default SYS_DEBUG_MESSAGE macro definition removes the message and
18346  function call from the source code. To access and utilize the message,
18347  define the SYS_DEBUG_USE_CONSOLE macro or override the definition of the
18348  SYS_DEBUG_MESSAGE macro.
18349 */
18350 #define _SYS_DEBUG_MESSAGE( level , message ) do { if ( ( level ) <= SYS_DEBUG_ErrorLevelGet ( ) ) SYS_DEBUG_Message ( message ) ; } while ( 0 )
18351 // *****************************************************************************
18352 /* Macro:
18353  _SYS_DEBUG_PRINT( SYS_ERROR_LEVEL level, const char* format, ... )
18354  Summary:
18355  Formats and prints a debug message if the specified level is at or below the
18356  global system error level.
18357  Description:
18358  This function formats and prints a debug message if the specified level is
18359  at or below the global system error level. It can be used to implement the
18360  SYS_DEBUG_PRINT macro.
18361  Precondition:
18362  SYS_DEBUG_Initialize must have returned a valid object handle.
18363  Parameters:
18364  level - The current error level threshold for displaying the message.
18365  format - Pointer to a buffer containing the format string for
18366  the message to be displayed.
18367  ... - Zero or more optional parameters to be formated as
18368  defined by the format string.
18369  Returns:
18370  None.
18371  Example:
18372  <code>
18373  // In system_config.h
18374 #define SYS_DEBUG_PRINT(level, format, ...) _SYS_DEBUG_PRINT(level, format, ##__VA_ARG__)
18375 
18376  // In source code
18377  int result;
18378 
18379  result = SomeOperation();
18380  if (result > MAX_VALUE)
18381  {
18382  SYS_DEBUG_PRINT(SYS_ERROR_WARNING, "Result of %d exceeds max value\r\n", result);
18383  // Take appropriate action
18384  }
18385  </code>
18386  Remarks:
18387  Do not call this macro directly. Call the SYS_DEBUG_PRINT macro instead.
18388 
18389  The default SYS_DEBUG_PRINT macro definition removes the message and
18390  function call from the source code. To access and utilize the message,
18391  define the SYS_DEBUG_USE_CONSOLE macro or override the definition of the
18392  SYS_DEBUG_PRINT macro.
18393 */
18394 #define _SYS_DEBUG_PRINT( level , format ,... ) do { if ( ( level ) <= SYS_DEBUG_ErrorLevelGet ( ) ) SYS_DEBUG_Print ( format , ## __VA_ARGS__ ) ; } while ( 0 )
18395 // DOM-IGNORE-BEGIN
18396 // *****************************************************************************
18397 /* These definitions support the SYS_DEBUG_USE_CONSOLE build-time configuration
18398  option. Defining SYS_DEBUG_USE_CONSOLE in the system configuration
18399  (system_config.h) will map the macros below to the appropriate system
18400  console functions.
18401 */
18402 // DOM-IGNORE-END
18403 // *****************************************************************************
18404 /* Macro:
18405  SYS_MESSAGE( const char* message )
18406  Summary:
18407  Prints a message to the console regardless of the system error level.
18408  Description:
18409  This macro is used to print a message to the console regardless of the
18410  system error level. It can be mapped to any desired implementation.
18411  Precondition:
18412  If mapped to the _SYS_MESSAGE function, then the system debug service must
18413  be initialized and running.
18414  Parameters:
18415  message - Pointer to a buffer containing the message string to be
18416  displayed.
18417  Returns:
18418  None.
18419  Example:
18420  <code>
18421  // In system_config.h:
18422 #define SYS_MESSAGE(message) _SYS_MESSAGE(message)
18423 
18424  // In source (.c) files:
18425  SYS_MESSAGE("My Message\n\r");
18426  </code>
18427  Remarks:
18428  By default, this macro is defined as nothing, effectively removing all code
18429  generated by calls to it. To process SYS_MESSAGE calls, this macro must be
18430  defined in a way that maps calls to it to the desired implementation (see
18431  example, above).
18432 
18433  This macro can be mapped to the system console service (along with other
18434  system debug macros) by defining SYS_DEBUG_USE_CONSOLE in the system
18435  configuration (system_config.h) instead of defining it individually.
18436 */
18437 #define SYS_MESSAGE( message )
18438 // *****************************************************************************
18439 /* Function:
18440  SYS_DEBUG_MESSAGE( const char* message )
18441  Summary:
18442  Prints a debug message if the system error level is defined defined at
18443  or lower than the level specified.
18444  Description:
18445  This function prints a debug message if the system error level is defined at
18446  or lower than the level specified.
18447  Precondition:
18448  SYSTEM_CURRENT_ERROR_LEVEL must be defined as SYS_ERROR_DEBUG.
18449  Parameters:
18450  level - The current error level threshold for displaying the message.
18451  message - Pointer to a buffer containing the message to be displayed.
18452  Returns:
18453  None.
18454  Example:
18455  <code>
18456 #define SYS_DEBUG_MESSAGE _SYS_DEBUG_MESSAGE
18457  SYS_ERROR_LevelSet(SYS_ERROR_DEBUG);
18458  SYS_DEBUG_MESSAGE("System Debug Message \n\r");
18459  </code>
18460  Remarks:
18461  By default, this macro is defined as nothing, effectively removing all code
18462  generated by calls to it. To process SYS_DEBUG_MESSAGE calls, this macro
18463  must be defined in a way that maps calls to it to the desired implementation
18464  (see example, above).
18465 
18466  This macro can be mapped to the system console service (along with other
18467  system debug macros) by defining SYS_DEBUG_USE_CONSOLE in the system
18468  configuration (system_config.h) instead of defining it individually.
18469 */
18470 #define SYS_DEBUG_MESSAGE( level , message )
18471 // *****************************************************************************
18472 /* Function:
18473  SYS_PRINT(const char* format, ...);
18474  Summary:
18475  Formats and prints an error message with a variable number of arguments
18476  regardless of the system error level.
18477  Description:
18478  This function formats and prints an error message with a variable number of
18479  if the system error level is defined at or lower than the level specified.
18480  Precondition:
18481  SYSTEM_CURRENT_ERROR_LEVEL must be defined.
18482  Parameters:
18483  format - Pointer to a buffer containing the format string for
18484  the message to be displayed.
18485  ... - Zero or more optional parameters to be formated as
18486  defined by the format string.
18487  Returns:
18488  None.
18489  Example:
18490  <code>
18491  // In system_config.h
18492 #define SYS_PRINT(format, ...) _SYS_DEBUG_PRINT(format, ##__VA_ARG__)
18493 
18494  // In source code
18495  int result;
18496 
18497  result = SomeOperation();
18498  if (result > MAX_VALUE)
18499  {
18500  SYS_PRINT("Result of %d exceeds max value\r\n", result);
18501  // Take appropriate action
18502  }
18503  </code>
18504  Remarks:
18505  The format string and arguments follow the printf convention. This function
18506  is called by the macros SYS_PRINT and SYS_ERROR_PRINT
18507 
18508  By default, this macro is defined as nothing, effectively removing all code
18509  generated by calls to it. To process SYS_PRINT calls, this macro must be
18510  defined in a way that maps calls to it to the desired implementation (see
18511  example, above).
18512 
18513  This macro can be mapped to the system console service (along with other
18514  system debug macros) by defining SYS_DEBUG_USE_CONSOLE in the system
18515  configuration (system_config.h) instead of defining it individually.
18516 */
18517 #define SYS_PRINT( fmt ,... )
18518 // *****************************************************************************
18519 /* Macro:
18520  SYS_DEBUG_PRINT( SYS_ERROR_LEVEL level, const char* format, ... )
18521  Summary:
18522  Formats and prints an error message if the system error level is defined at
18523  or lower than the level specified.
18524  Description:
18525  This macro formats and prints an error message if the system error level
18526  is defined at or lower than the level specified.o
18527  Precondition:
18528  SYS_DEBUG_Initialize must have returned a valid object handle.
18529  Parameters:
18530  level - The current error level threshold for displaying the message.
18531  format - Pointer to a buffer containing the format string for
18532  the message to be displayed.
18533  ... - Zero or more optional parameters to be formated as
18534  defined by the format string.
18535  Returns:
18536  None.
18537  Example:
18538  <code>
18539  // In system_config.h
18540 #define SYS_DEBUG_PRINT(level, format, ...) _SYS_DEBUG_PRINT(level, format, ##__VA_ARG__)
18541 
18542  // In source code
18543  int result;
18544 
18545  result = SomeOperation();
18546  if (result > MAX_VALUE)
18547  {
18548  SYS_DEBUG_PRINT(SYS_ERROR_WARNING, "Result of %d exceeds max value\r\n", result);
18549  // Take appropriate action
18550  }
18551  </code>
18552  Remarks:
18553  The format string and arguments follow the printf convention. This function
18554  is called by the macros SYS_PRINT and SYS_DEBUG_PRINT.
18555 
18556  By default, this macro is defined as nothing, effectively removing all code
18557  generated by calls to it. To process SYS_MESSAGE calls, this macro must be
18558  defined in a way that maps calls to it to the desired implementation (see
18559  example, above).
18560 
18561  This macro can be mapped to the system console service (along with other
18562  system debug macros) by defining SYS_DEBUG_USE_CONSOLE in the system
18563  configuration (system_config.h) instead of defining it individually.
18564 */
18565 #define SYS_DEBUG_PRINT( level , fmt ,... )
18566 // *****************************************************************************
18567 /* Macro:
18568  SYS_DEBUG_BreakPoint( void )
18569  Summary:
18570  Inserts a software breakpoint instruction when building in Debug mode.
18571  Description:
18572  This macro inserts a software breakpoint instruction when building in Debug
18573  mode.
18574  Precondition:
18575  None.
18576  Parameters:
18577  None.
18578  Returns:
18579  None.
18580  Example:
18581  <code>
18582  if (myDebugTestFailed)
18583  {
18584  SYS_DEBUG_BreakPoint();
18585  }
18586  </code>
18587  Remarks:
18588  Compiles out if not built for debugging.
18589 */
18590 #define SYS_DEBUG_BreakPoint( )
18591 // *****************************************************************************
18592 // *****************************************************************************
18593 // Section: SYS DEBUG Deprecated Macros
18594 // *****************************************************************************
18595 // *****************************************************************************
18596 /* Do not use these macros for new development.
18597 */
18598 //DOM-IGNORE-BEGIN
18599 #define SYS_DEBUG( level , message ) SYS_DEBUG_MESSAGE ( level , message )
18600 #define SYS_ERROR( level , fmt ,... ) SYS_DEBUG_PRINT ( level , fmt , ## __VA_ARGS__ )
18601 #define SYS_ERROR_PRINT( level , fmt ,... ) SYS_DEBUG_PRINT ( level , fmt , ## __VA_ARGS__ )
18602 //DOM-IGNORE-END
18603  // _SYS_DEBUG_H
18604 /*******************************************************************************
18605  End of File
18606 */
18607 #endif /*00 C:\microchip\harmony\v2_06\framework\system\debug\sys_debug.h*/
18608 /* CLOSE_FILE Include File */
18609 
18610 // DOM-IGNORE-BEGIN
18611 // DOM-IGNORE-END
18612 // *****************************************************************************
18613 // *****************************************************************************
18614 // Section: Data Type Definitions
18615 // *****************************************************************************
18616 // *****************************************************************************
18617 /* USART FIFO+RX(8+1) size */
18618 #define _DRV_USART_RX_DEPTH 9
18619 // *****************************************************************************
18620 /* USART Static Driver Instance Object
18621  Summary:
18622  Object used to keep any data required for the static USART driver.
18623  Description:
18624  This object is used to keep track of any data that must be maintained to
18625  manage the USART static driver.
18626  Remarks:
18627  None.
18628 */
18629 
18630 typedef
18631  struct
18632  {
18633  /* Client specific error */
18634  DRV_USART_ERROR error ;
18635  } DRV_USART_OBJ ;
18636 // *****************************************************************************
18637 // *****************************************************************************
18638 // Section: Local functions.
18639 // *****************************************************************************
18640 // *****************************************************************************
18641 // DOM-IGNORE-BEGIN
18642 // DOM-IGNORE-END
18643  //#ifndef _DRV_USART_STATIC_LOCAL_H
18644 /*******************************************************************************
18645  End of File
18646 */
18647 
18648 #endif /*00 C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\framework\driver\usart\src\drv_usart_static_local.h*/
18649 /* CLOSE_FILE Include File */
18650 
18651 // DOM-IGNORE-BEGIN
18652 // DOM-IGNORE-END
18653 // *********************************************************************************************
18654 // *********************************************************************************************
18655 // Section: System Interface Headers for the Instance 0 of USART static driver
18656 // *********************************************************************************************
18657 // *********************************************************************************************
18658 
18659 SYS_MODULE_OBJ
18660  DRV_USART0_Initialize ( void ) ;
18661 
18662 void
18663  DRV_USART0_Deinitialize ( void ) ;
18664 
18665 SYS_STATUS
18666  DRV_USART0_Status ( void ) ;
18667 
18668 void
18669  DRV_USART0_TasksTransmit ( void ) ;
18670 
18671 void
18672  DRV_USART0_TasksReceive ( void ) ;
18673 
18674 void
18675  DRV_USART0_TasksError ( void ) ;
18676 // *********************************************************************************************
18677 // *********************************************************************************************
18678 // Section: General Client Interface Headers for the Instance 0 of USART static driver
18679 // *********************************************************************************************
18680 // *********************************************************************************************
18681 
18682 DRV_HANDLE
18683  DRV_USART0_Open (
18684  const SYS_MODULE_INDEX index ,
18685  const DRV_IO_INTENT ioIntent ) ;
18686 
18687 void
18688  DRV_USART0_Close ( void ) ;
18689 
18691  DRV_USART0_ClientStatus ( void ) ;
18692 
18694  DRV_USART0_TransferStatus ( void ) ;
18695 
18697  DRV_USART0_ErrorGet ( void ) ;
18698 // *********************************************************************************************
18699 // *********************************************************************************************
18700 // Section: Byte Model Client Interface Headers for the Instance 0 of USART static driver
18701 // *********************************************************************************************
18702 // *********************************************************************************************
18703 
18704 uint8_t
18705  DRV_USART0_ReadByte ( void ) ;
18706 
18707 void
18709  const uint8_t byte ) ;
18710 
18711 unsigned int
18713 
18714 unsigned int
18716 
18717 bool
18719 
18720 bool
18722 // *********************************************************************************************
18723 // *********************************************************************************************
18724 // Section: Set up Client Interface Headers for the Instance 0 of USART static driver
18725 // *********************************************************************************************
18726 // *********************************************************************************************
18727 
18730  uint32_t baud ) ;
18731 
18734  DRV_USART_LINE_CONTROL lineControlMode ) ;
18735 // DOM-IGNORE-BEGIN
18736 // DOM-IGNORE-END
18737  // #ifndef _DRV_USART_STATIC_H
18738 /*******************************************************************************
18739  End of File
18740 */
18741 
18742 #endif /*00 C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\framework\driver\usart\drv_usart_static.h*/
18743 /* CLOSE_FILE Include File */
18744 
18745 /* OPEN FILE C:\microchip\harmony\v2_06\framework\system\ports\sys_ports.h */
18746 /*******************************************************************************
18747  Ports System Service Interface Definition
18748  Company:
18749  Microchip Technology Inc.
18750  File Name:
18751  sys_ports.h
18752  Summary:
18753  Ports System Service interface definitions
18754  Description:
18755  This file contains the interface definition for the Ports system
18756  service. It provides a way to interact with the Ports subsystem to
18757  manage the timing requests supported by the system
18758 *******************************************************************************/
18759 //DOM-IGNORE-BEGIN
18760 /*******************************************************************************
18761 Copyright (c) 2013-2015 released Microchip Technology Inc. All rights reserved.
18762 Microchip licenses to you the right to use, modify, copy and distribute
18763 Software only when embedded on a Microchip microcontroller or digital signal
18764 controller that is integrated into your product or third party product
18765 (pursuant to the sublicense terms in the accompanying license agreement).
18766 You should refer to the license agreement accompanying this Software for
18767 additional information regarding your rights and obligations.
18768 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
18769 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
18770 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
18771 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
18772 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
18773 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
18774 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
18775 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
18776 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
18777 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
18778 *******************************************************************************/
18779 //DOM-IGNORE-END
18780 #ifndef _SYS_PORTS_H
18781 #define _SYS_PORTS_H
18782 // *****************************************************************************
18783 // *****************************************************************************
18784 // Section: Included Files
18785 // *****************************************************************************
18786 // *****************************************************************************
18787 /* OPEN FILE C:\microchip\harmony\v2_06\framework\system\ports\sys_ports_definitions.h */
18788 /*******************************************************************************
18789  PORTS System Service Library Interface Definition
18790  Company:
18791  Microchip Technology Inc.
18792  File Name:
18793  sys_ports_definitions.h
18794  Summary:
18795  PORTS System Service data type definitions header.
18796  Description:
18797  This file contains data type definitions header.
18798 *******************************************************************************/
18799 //DOM-IGNORE-BEGIN
18800 /*******************************************************************************
18801 Copyright (c) 2013-2015 released Microchip Technology Inc. All rights reserved.
18802 Microchip licenses to you the right to use, modify, copy and distribute
18803 Software only when embedded on a Microchip microcontroller or digital signal
18804 controller that is integrated into your product or third party product
18805 (pursuant to the sublicense terms in the accompanying license agreement).
18806 You should refer to the license agreement accompanying this Software for
18807 additional information regarding your rights and obligations.
18808 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
18809 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
18810 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
18811 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
18812 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
18813 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
18814 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
18815 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
18816 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
18817 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
18818 *******************************************************************************/
18819 //DOM-IGNORE-END
18820 #ifndef _SYS_PORTS_DEFINITIONS_H
18821 #define _SYS_PORTS_DEFINITIONS_H
18822 // *****************************************************************************
18823 // *****************************************************************************
18824 // Section: File includes
18825 // *****************************************************************************
18826 // *****************************************************************************
18827 #include "C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\system_config.h" /* LDRA full path */
18828 #include "system/common/sys_common.h"
18829 #include "system/common/sys_module.h"
18830 /* OPEN FILE C:\microchip\harmony\v2_06\framework\peripheral\ports\plib_ports.h */
18831 /*******************************************************************************
18832  Ports Peripheral Library Interface Header
18833  Company:
18834  Microchip Technology Inc.
18835  File Name:
18836  plib_ports.h
18837  Summary:
18838  Ports Peripheral Library Interface header for Ports function definitions.
18839  Description:
18840  This header file contains the function prototypes and definitions of
18841  the data types and constants that make up the interface to the Ports
18842  Peripheral Library for all families of Microchip microcontrollers. The
18843  definitions in this file are common to the Ports peripheral.
18844 *******************************************************************************/
18845 // DOM-IGNORE-BEGIN
18846 /*******************************************************************************
18847 Copyright 2013-2015 released Microchip Technology Inc. All rights reserved.
18848 Microchip licenses to you the right to use, modify, copy and distribute
18849 Software only when embedded on a Microchip microcontroller or digital signal
18850 controller that is integrated into your product or third party product
18851 (pursuant to the sublicense terms in the accompanying license agreement).
18852 You should refer to the license agreement accompanying this Software for
18853 additional information regarding your rights and obligations.
18854 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
18855 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
18856 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
18857 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
18858 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
18859 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
18860 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
18861 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
18862 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
18863 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
18864 *******************************************************************************/
18865 // DOM-IGNORE-END
18866 #ifndef _PLIB_PORTS_H
18867 #define _PLIB_PORTS_H
18868 #include <stdint.h>
18869 #include <stddef.h>
18870 // DOM-IGNORE-BEGIN
18871 // DOM-IGNORE-END
18872 // *****************************************************************************
18873 // *****************************************************************************
18874 // Section: Constants & Data Types
18875 // *****************************************************************************
18876 // *****************************************************************************
18877 // *****************************************************************************
18878 /* Ports data mask definition
18879  Summary:
18880  Data type defining the Ports data mask
18881  Description:
18882  This data type defines the Ports data mask
18883  Remarks:
18884  None.
18885 */
18886 
18887 typedef
18888 uint16_t
18890 // *****************************************************************************
18891 /* Ports data type definition
18892  Summary:
18893  Data type defining the Ports data type.
18894  Description:
18895  This data type defines the Ports data type.
18896  Remarks:
18897  None.
18898 */
18899 
18900 typedef
18901 uint32_t
18903 // *****************************************************************************
18904 // *****************************************************************************
18905 // Section: Included Files (continued at end of file)
18906 // *****************************************************************************
18907 // *****************************************************************************
18908 /* This section lists the other files that are included in this file. However,
18909  please see the end of the file for additional implementation header files
18910  that are also included.
18911 */
18912 /* OPEN FILE C:\microchip\harmony\v2_06\framework\peripheral\ports\processor\ports_processor.h */
18913 //DOM-IGNORE-BEGIN
18914 /*******************************************************************************
18915 Copyright (c) 2011-2016 released Microchip Technology Inc. All rights reserved.
18916 Microchip licenses to you the right to use, modify, copy and distribute
18917 Software only when embedded on a Microchip microcontroller or digital signal
18918 controller that is integrated into your product or third party product
18919 (pursuant to the sublicense terms in the accompanying license agreement).
18920 You should refer to the license agreement accompanying this Software for
18921 additional information regarding your rights and obligations.
18922 SOFTWARE AND DOCUMENTATION ARE PROVIDED 'AS IS' WITHOUT WARRANTY OF ANY KIND,
18923 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
18924 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
18925 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
18926 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
18927 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
18928 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
18929 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
18930 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
18931 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
18932  *******************************************************************************/
18933 //DOM-IGNORE-END
18934 #ifndef _PLIB_PORTS_PROCESSOR_H
18935 #define _PLIB_PORTS_PROCESSOR_H
18936 #error "Can't find header"
18937 #endif /*00 C:\microchip\harmony\v2_06\framework\peripheral\ports\processor\ports_processor.h*/
18938 /* CLOSE_FILE Include File */
18939 
18940 // *****************************************************************************
18941 // *****************************************************************************
18942 // Section: Ports Peripheral Library Interface Routines
18943 // *****************************************************************************
18944 // *****************************************************************************
18945 // *****************************************************************************
18946 /* Function:
18947  void PLIB_PORTS_RemapInput( PORTS_MODULE_ID index,
18948  PORTS_REMAP_INPUT_FUNCTION inputFunction,
18949  PORTS_REMAP_INPUT_PIN remapInputPin );
18950  Summary:
18951  Input function remapping.
18952  Description:
18953  This function controls the Input function remapping. It allows user to map
18954  any of the input functionality on any of the remappable input pin.
18955  This function does not perform atomic register access.
18956  Precondition:
18957  IOLOCK bit of configuration register should be clear to allow any remapping.
18958  PLIB_DEVCON_DeviceRegistersUnlock function can be used for that purpose.
18959  Refer DEVCON PLIB (or System Service) and the specific device data sheet to
18960  find more information.
18961  Parameters:
18962  index - Identifier for the device instance to be configured
18963  inputFunction - One of the possible values of PORTS_REMAP_INPUT_FUNCTION
18964  remapInputPin - One of the possible values of PORTS_REMAP_INPUT_PIN
18965  Returns:
18966  None.
18967  Example:
18968  <code>
18969 
18970  // System Unlock
18971  PLIB_DEVCON_SystemUnlock(DEVCON_ID_0);
18972  // Unlock PPS registers
18973  PLIB_DEVCON_DeviceRegistersUnlock(DEVCON_ID_0, DEVCON_PPS_REGISTERS);
18974  // Remapping input function 'Input Capture 1' to the Remappable pin 'RPD2'
18975  PLIB_PORTS_RemapInput(PORTS_ID_0, INPUT_FUNC_IC1, INPUT_PIN_RPD2 );
18976  </code>
18977  Remarks:
18978  This feature may not be available on all devices. Please refer to the
18979  specific device data sheet to determine availability or use
18980  PLIB_PORTS_ExistsRemapInputOutput in your application to determine whether
18981  this feature is available.
18982 */
18983 
18984 void
18986  PORTS_MODULE_ID index ,
18987  PORTS_REMAP_INPUT_FUNCTION inputFunction ,
18988  PORTS_REMAP_INPUT_PIN remapInputPin ) ;
18989 // *****************************************************************************
18990 /* Function:
18991  void PLIB_PORTS_RemapOutput( PORTS_MODULE_ID index,
18992  PORTS_REMAP_OUTPUT_FUNCTION outputFunction,
18993  PORTS_REMAP_OUTPUT_PIN remapOutputPin );
18994  Summary:
18995  Output function remapping.
18996  Description:
18997  This function controls the Output function remapping. it allows user to map
18998  any of the output functionality on any of the remappable output pin.
18999  This function does not perform atomic register access.
19000  Precondition:
19001  IOLOCK bit of configuration register should be clear to allow any remapping.
19002  PLIB_DEVCON_DeviceRegistersUnlock function can be used for that purpose.
19003  Refer DEVCON PLIB (or System Service) and the specific device data sheet to
19004  find more information.
19005  Parameters:
19006  index - Identifier for the device instance to be configured
19007  outputFunction - One of the possible values of PORTS_REMAP_OUTPUT_FUNCTION
19008  remapOutputPin - One of the possible values of PORTS_REMAP_OUTPUT_PIN
19009  Returns:
19010  None.
19011  Example:
19012  <code>
19013 
19014  // System Unlock
19015  PLIB_DEVCON_SystemUnlock(DEVCON_ID_0);
19016  // Unlock PPS registers
19017  PLIB_DEVCON_DeviceRegistersUnlock(DEVCON_ID_0, DEVCON_PPS_REGISTERS);
19018  // Remapping output function 'UART3 Transmit' to the Remappable pin 'RPA14'
19019  PLIB_PORTS_RemapOutput(PORTS_ID_0, OUTPUT_FUNC_U3TX, OUTPUT_PIN_RPA14);
19020 
19021  </code>
19022  Remarks:
19023  This feature may not be available on all devices. Please refer to the
19024  specific device data sheet to determine availability or use
19025  PLIB_PORTS_ExistsRemapInputOutput in your application to determine whether
19026  this feature is available.
19027 */
19028 
19029 void
19031  PORTS_MODULE_ID index ,
19032  PORTS_REMAP_OUTPUT_FUNCTION outputFunction ,
19033  PORTS_REMAP_OUTPUT_PIN remapOutputPin ) ;
19034 // *****************************************************************************
19035 /* Function:
19036  void PLIB_PORTS_PinModeSelect( PORTS_MODULE_ID index,
19037  PORTS_ANALOG_PIN pin,
19038  PORTS_PIN_MODE mode );
19039  Summary:
19040  Enables the selected pin as analog or digital.
19041  Description:
19042  This function enables the selected pin as analog or digital.
19043  This function does not perform atomic register access.
19044  Precondition:
19045  None.
19046  Parameters:
19047  index - Identifier for the device instance to be configured
19048  pin - Possible values of PORTS_ANALOG_PIN
19049  mode - Possible values of PORTS_PIN_MODE
19050  Returns:
19051  None.
19052  Example:
19053  <code>
19054 
19055  // Make AN0 pin as Analog
19056  PLIB_PORTS_PinModeSelect(PORTS_ID_0, PORTS_ANALOG_PIN_0, PORTS_PIN_MODE_ANALOG);
19057 
19058  </code>
19059  Remarks:
19060  This feature may not be available on all devices. Please refer to the
19061  specific device data sheet to determine availability or use
19062  PLIB_PORTS_ExistsPinMode in your application to determine whether
19063  this feature is available.
19064 */
19065 
19066 void
19068  PORTS_MODULE_ID index ,
19069  PORTS_ANALOG_PIN pin ,
19070  PORTS_PIN_MODE mode ) ;
19071 // *****************************************************************************
19072 /* Function:
19073  void PLIB_PORTS_PinModePerPortSelect( PORTS_MODULE_ID index,
19074  PORTS_CHANNEL channel, PORTS_BIT_POS bitPos,
19075  PORTS_PIN_MODE mode );
19076  Summary:
19077  Enables the selected port pin as analog or digital.
19078  Description:
19079  This function enables the selected port pin as analog or digital.
19080  This function does not perform atomic register access.
19081  Precondition:
19082  None.
19083  Parameters:
19084  index - Identifier for the device instance to be configured
19085  channel - Port pin channel
19086  bitPos - Position in the PORT pins
19087  mode - Possible values of PORTS_PIN_MODE
19088  Returns:
19089  None.
19090  Example:
19091  <code>
19092 
19093  // Make RC5 pin Analog
19094  PLIB_PORTS_PinModePerPortSelect(PORTS_ID_0, PORT_CHANNEL_C,
19095  PORTS_BIT_POS_5, PORTS_PIN_MODE_ANALOG);
19096 
19097  </code>
19098  Remarks:
19099  This function is only available in devices with PPS. For Non-PPS devices, use the
19100  PLIB_PORTS_PinModeSelect function.
19101 
19102  This feature may not be available on all devices. Please refer to the
19103  specific device data sheet to determine availability or use
19104  PLIB_PORTS_ExistsPinModePerPort in your application to determine whether
19105  this feature is available.
19106 */
19107 
19108 void
19110  PORTS_MODULE_ID index ,
19111  PORTS_CHANNEL channel ,
19112  PORTS_BIT_POS bitPos ,
19113  PORTS_PIN_MODE mode ) ;
19114 // *****************************************************************************
19115 /* Function:
19116  void PLIB_PORTS_ChangeNoticePullDownPerPortEnable( PORTS_MODULE_ID index,
19117  PORTS_CHANNEL channel, PORTS_BIT_POS bitPos )
19118  Summary:
19119  Enables the pull-down for selected Change Notice pins.
19120  Description:
19121  This function enables the pull-down for selected Change Notice pins.
19122  This function does not perform atomic register access.
19123  Precondition:
19124  None.
19125  Parameters:
19126  index - Identifier for the device instance to be configured
19127  channel - Port pin channel
19128  bitPos - Position in the PORT pins
19129  Returns:
19130  None.
19131  Example:
19132  <code>
19133 
19134  // Enable pull-down for RC5 pin
19135  PLIB_PORTS_ChangeNoticePullDownPerPortEnable(PORTS_ID_0, PORT_CHANNEL_C,
19136  PORTS_BIT_POS_5);
19137 
19138  </code>
19139  Remarks:
19140  This feature may not be available on all devices. Please refer to the
19141  specific device data sheet to determine availability or use
19142  PLIB_PORTS_ExistsChangeNoticePullDownPerPort in your application to
19143  determine whether this feature is available.
19144 */
19145 
19146 void
19148  PORTS_MODULE_ID index ,
19149  PORTS_CHANNEL channel ,
19150  PORTS_BIT_POS bitPos ) ;
19151 // *****************************************************************************
19152 /* Function:
19153  void PLIB_PORTS_ChangeNoticePullDownPerPortDisable( PORTS_MODULE_ID index,
19154  PORTS_CHANNEL channel, PORTS_BIT_POS bitPos )
19155  Summary:
19156  Disables the pull-down for selected Change Notice pins.
19157  Description:
19158  This function disables the pull-down for selected Change Notice pins.
19159  This function does not perform atomic register access.
19160  Precondition:
19161  None.
19162  Parameters:
19163  index - Identifier for the device instance to be configured
19164  channel - Port pin channel
19165  bitPos - Position in the PORT pins
19166  Returns:
19167  None.
19168  Example:
19169  <code>
19170 
19171  // Disable pull-down for RC5 pin
19172  PLIB_PORTS_ChangeNoticePullDownPerPortDisable(PORTS_ID_0, PORT_CHANNEL_C,
19173  PORTS_BIT_POS_5);
19174  </code>
19175  Remarks:
19176  This feature may not be available on all devices. Please refer to the
19177  specific device data sheet to determine availability or use
19178  PLIB_PORTS_ExistsChangeNoticePullDownPerPort in your application to
19179  determine whether this feature is available.
19180 */
19181 
19182 void
19184  PORTS_MODULE_ID index ,
19185  PORTS_CHANNEL channel ,
19186  PORTS_BIT_POS bitPos ) ;
19187 // *****************************************************************************
19188 /* Function:
19189  void PLIB_PORTS_ChangeNoticePullUpPerPortEnable ( PORTS_MODULE_ID index,
19190  PORTS_CHANNEL channel, PORTS_BIT_POS bitPos )
19191  Summary:
19192  Enables the pull-up for selected Change Notice pins.
19193  Description:
19194  This function enables the pull-up for selected Change Notice pins.
19195  This function does not perform atomic register access.
19196  Precondition:
19197  None.
19198  Parameters:
19199  index - Identifier for the device instance to be configured
19200  channel - Port pin channel
19201  bitPos - Position in the PORT pins
19202  Returns:
19203  None.
19204  Example:
19205  <code>
19206 
19207  // Enable pull-up for RC5 pin
19208  PLIB_PORTS_ChangeNoticePullUpPerPortEnable(PORTS_ID_0, PORT_CHANNEL_C,
19209  PORTS_BIT_POS_5);
19210  </code>
19211  Remarks:
19212  This function is only available in devices with PPS. For Non-PPS devices, use the
19213  PLIB_PORTS_ChangeNoticePullUpEnable function.
19214 
19215  This feature may not be available on all devices. Please refer to the
19216  specific device data sheet to determine availability or use
19217  PLIB_PORTS_ExistsChangeNoticePullUpPerPort in your application to
19218  determine whether this feature is available.
19219 */
19220 
19221 void
19223  PORTS_MODULE_ID index ,
19224  PORTS_CHANNEL channel ,
19225  PORTS_BIT_POS bitPos ) ;
19226 // *****************************************************************************
19227 /* Function:
19228  void PLIB_PORTS_ChangeNoticePullUpPerPortDisable( PORTS_MODULE_ID index,
19229  PORTS_CHANNEL channel, PORTS_BIT_POS bitPos );
19230  Summary:
19231  Disables weak pull-up for the selected pin.
19232  Description:
19233  This function disables weak pull-up for the selected port pin.
19234  This function does not perform atomic register access.
19235  Precondition:
19236  None.
19237  Parameters:
19238  index - Identifier for the device instance to be configured
19239  channel - Port pin channel
19240  bitPos - Position in the PORT pins
19241  Returns:
19242  None.
19243  Example:
19244  <code>
19245 
19246  // Disable pull-up for RC5 pin
19247  PLIB_PORTS_ChangeNoticePullUpPerPortDisable(PORTS_ID_0, PORT_CHANNEL_C,
19248  PORTS_BIT_POS_5);
19249 
19250  </code>
19251  Remarks:
19252  This function is only available in devices with PPS. For Non-PPS devices, use the
19253  PLIB_PORTS_ChangeNoticePullUpDisable function.
19254 
19255  Pull-ups on change notification pins should always be disabled when the
19256  port pin is configured as a digital output.
19257 
19258  This feature may not be available on all devices. Please refer to the
19259  specific device data sheet to determine availability or use
19260  PLIB_PORTS_ExistsChangeNoticePullUpPerPort in your application to
19261  determine whether this feature is available.
19262 */
19263 
19264 void
19266  PORTS_MODULE_ID index ,
19267  PORTS_CHANNEL channel ,
19268  PORTS_BIT_POS bitPos ) ;
19269 // *****************************************************************************
19270 /* Function:
19271  void PLIB_PORTS_PinChangeNoticePerPortEnable ( PORTS_MODULE_ID index,
19272  PORTS_CHANNEL channel, PORTS_BIT_POS bitPos )
19273  Summary:
19274  Enables CN interrupt for the selected pin.
19275  Description:
19276  This function enables Change Notice interrupt for the selected port pin.
19277  This function does not perform atomic register access.
19278 
19279  Precondition:
19280  None.
19281  Parameters:
19282  index - Identifier for the device instance to be configured
19283  channel - Port pin channel
19284  bitPos - Position in the PORT pins
19285  Returns:
19286  None.
19287  Example:
19288  <code>
19289 
19290  // Enable CN interrupt for RC5 pin
19291  PLIB_PORTS_PinChangeNoticePerPortEnable(PORTS_ID_0, PORT_CHANNEL_C,
19292  PORTS_BIT_POS_5);
19293 
19294  </code>
19295  Remarks:
19296  This function is only available in devices with PPS. For Non-PPS devices, use the
19297  PLIB_PORTS_PinChangeNoticeEnable function.
19298 
19299  This feature may not be available on all devices. Please refer to the
19300  specific device data sheet to determine availability or use
19301  PLIB_PORTS_ExistsChangeNoticeIntPerPort in your application to
19302  determine whether this feature is available.
19303 */
19304 
19305 void
19307  PORTS_MODULE_ID index ,
19308  PORTS_CHANNEL channel ,
19309  PORTS_BIT_POS bitPos ) ;
19310 // *****************************************************************************
19311 /* Function:
19312  void PLIB_PORTS_PinChangeNoticePerPortDisable( PORTS_MODULE_ID index,
19313  PORTS_CHANNEL channel, PORTS_BIT_POS bitPos )
19314  Summary:
19315  Disables CN interrupt for the selected pin.
19316  Description:
19317  This function disables Change Notice interrupt for the selected port pin.
19318  This function does not perform atomic register access.
19319  Precondition:
19320  None.
19321  Parameters:
19322  index - Identifier for the device instance to be configured
19323  channel - Port pin channel
19324  bitPos - Position in the PORT pins
19325  Returns:
19326  None.
19327  Example:
19328  <code>
19329 
19330  // Disable CN interrupt for RC5 pin
19331  PLIB_PORTS_PinChangeNoticePerPortDisable(PORTS_ID_0, PORT_CHANNEL_C,
19332  PORTS_BIT_POS_5);
19333 
19334  </code>
19335  Remarks:
19336  This function is only available in devices with PPS. For Non-PPS devices, use the
19337  PLIB_PORTS_PinChangeNoticeDisable function.
19338 
19339  This feature may not be available on all devices. Please refer to the
19340  specific device data sheet to determine availability or use
19341  PLIB_PORTS_ExistsChangeNoticeIntPerPort in your application to
19342  determine whether this feature is available.
19343 */
19344 
19345 void
19347  PORTS_MODULE_ID index ,
19348  PORTS_CHANNEL channel ,
19349  PORTS_BIT_POS bitPos ) ;
19350 // *****************************************************************************
19351 /* Function:
19352  void PLIB_PORTS_ChangeNoticePerPortTurnOn ( PORTS_MODULE_ID index,
19353  PORTS_CHANNEL channel );
19354  Summary:
19355  Enables the change notification for selected port.
19356  Description:
19357  This function enables the change notification for selected port.
19358  This function does not perform atomic register access.
19359  Precondition:
19360  None.
19361  Parameters:
19362  index - Identifier for the device instance to be configured
19363  channel - Port pin channel
19364  Returns:
19365  None.
19366  Example:
19367  <code>
19368  // Enable Change notification for Port C
19369  PLIB_PORTS_ChangeNoticePerPortTurnOn(PORTS_ID_0, PORT_CHANNEL_C);
19370 
19371  </code>
19372  Remarks:
19373  This function is only available in devices with PPS. For Non-PPS devices, use the
19374  PLIB_PORTS_ChangeNoticeEnable function.
19375 
19376  This feature may not be available on all devices. Please refer to the
19377  specific device data sheet to determine availability or use
19378  PLIB_PORTS_ExistsChangeNoticePerPortTurnOn in your application to determine
19379  whether this feature is available.
19380 */
19381 
19382 void
19384  PORTS_MODULE_ID index ,
19385  PORTS_CHANNEL channel ) ;
19386 // *****************************************************************************
19387 /* Function:
19388  void PLIB_PORTS_ChangeNoticePerPortTurnOff( PORTS_MODULE_ID index,
19389  PORTS_CHANNEL channel );
19390  Summary:
19391  Disables the change notification for selected port.
19392  Description:
19393  This function disables the change notification for selected port.
19394  This function does not perform atomic register access.
19395  Precondition:
19396  None.
19397  Parameters:
19398  index - Identifier for the device instance to be configured
19399  channel - Port pin channel
19400  Returns:
19401  None.
19402  Example:
19403  <code>
19404  // Disable Change notification for Port C
19405  PLIB_PORTS_ChangeNoticePerPortTurnOff(PORTS_ID_0, PORT_CHANNEL_C);
19406 
19407  </code>
19408  Remarks:
19409  This function is only available in devices with PPS. For Non-PPS devices, use the
19410  PLIB_PORTS_ChangeNoticeDisable function.
19411 
19412  This feature may not be available on all devices. Please refer to the
19413  specific device data sheet to determine availability or use
19414  PLIB_PORTS_ExistsChangeNoticePerPortTurnOn in your application to determine
19415  whether this feature is available.
19416 */
19417 
19418 void
19420  PORTS_MODULE_ID index ,
19421  PORTS_CHANNEL channel ) ;
19422 // *****************************************************************************
19423 /* Function:
19424  void PLIB_PORTS_ChangeNoticeInIdlePerPortEnable ( PORTS_MODULE_ID index,
19425  PORTS_CHANNEL channel );
19426  Summary:
19427  Allows CN to be working in Idle mode for selected channel.
19428  Description:
19429  This function makes sure that change notification feature keeps working in
19430  Idle mode for the selected channel.
19431  This function does not perform atomic register access.
19432  Precondition:
19433  None.
19434  Parameters:
19435  index - Identifier for the device instance to be configured
19436  channel - Port pin channel
19437  Returns:
19438  None.
19439  Example:
19440  <code>
19441 
19442  // Change notification continues working in Idle mode for Port C
19443  PLIB_PORTS_ChangeNoticeInIdlePerPortEnable(PORTS_ID_0, PORT_CHANNEL_C);
19444 
19445  </code>
19446  Remarks:
19447  This function is only available in devices with PPS. For Non-PPS devices, use the
19448  PLIB_PORTS_ChangeNoticeInIdleEnable function.
19449 
19450  This feature may not be available on all devices. Please refer to the
19451  specific device data sheet to determine availability or use
19452  PLIB_PORTS_ExistsChangeNoticePerPortInIdle in your application to determine
19453  whether this feature is available.
19454 */
19455 
19456 void
19458  PORTS_MODULE_ID index ,
19459  PORTS_CHANNEL channel ) ;
19460 // *****************************************************************************
19461 /* Function:
19462  void PLIB_PORTS_ChangeNoticeInIdlePerPortDisable( PORTS_MODULE_ID index,
19463  PORTS_CHANNEL channel );
19464  Summary:
19465  Change Notification halts in Idle mode for selected channel.
19466  Description:
19467  This function makes sure that change notification feature halts in
19468  Idle mode for the selected channel.
19469  This function does not perform atomic register access.
19470  Precondition:
19471  None.
19472  Parameters:
19473  index - Identifier for the device instance to be configured
19474  channel - Port pin channel
19475  Returns:
19476  None.
19477  Example:
19478  <code>
19479 
19480  // Change notification halts in Idle mode for Port C
19481  PLIB_PORTS_ChangeNoticeInIdlePerPortDisable(PORTS_ID_0, PORT_CHANNEL_C);
19482 
19483  </code>
19484  Remarks:
19485  This function is only available in devices with PPS. For Non-PPS devices, use the
19486  PLIB_PORTS_ChangeNoticeInIdleDisable function.
19487 
19488  This feature may not be available on all devices. Please refer to the
19489  specific device data sheet to determine availability or use
19490  PLIB_PORTS_ExistsChangeNoticePerPortInIdle in your application to determine
19491  whether this feature is available.
19492 */
19493 
19494 void
19496  PORTS_MODULE_ID index ,
19497  PORTS_CHANNEL channel ) ;
19498 // *****************************************************************************
19499 /* Function:
19500  bool PLIB_PORTS_ChangeNoticePerPortHasOccurred ( PORTS_MODULE_ID index,
19501  PORTS_CHANNEL channel, PORTS_BIT_POS bitPos );
19502  Summary:
19503  checks the status of change on the pin
19504  Description:
19505  This function checks if the change has occurred on the given pin or not.
19506  This function does not perform atomic register access.
19507  Precondition:
19508  None.
19509  Parameters:
19510  index - Identifier for the device instance to be configured
19511  channel - Port pin channel
19512  bitPos - Position in the PORT pins
19513  Returns:
19514  None.
19515  Example:
19516  <code>
19517 
19518  if(PLIB_PORTS_ChangeNoticePerPortHasOccurred( PORTS_ID_0,
19519  PORT_CHANNEL_C, PORTS_BIT_POS_4 ) == True)
19520  {
19521  //do something
19522  }
19523 
19524  </code>
19525  Remarks:
19526  This feature may not be available on all devices. Please refer to the
19527  specific device data sheet to determine availability or use
19528  PLIB_PORTS_ExistsChangeNoticePerPortStatus in your application to determine
19529  whether this feature is available.
19530 */
19531 
19532 bool
19534  PORTS_MODULE_ID index ,
19535  PORTS_CHANNEL channel ,
19536  PORTS_BIT_POS bitPos ) ;
19537 // *****************************************************************************
19538 /* Function:
19539  bool PLIB_PORTS_PinGet( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
19540  PORTS_BIT_POS bitPos )
19541  Summary:
19542  Reads/Gets data from the selected digital pin.
19543  Description:
19544  This function reads/gets data from the selected digital PORT i/o pin.
19545  This function should be used to read the live data at the pin.
19546  This function does not perform atomic register access.
19547 
19548  Precondition:
19549  None.
19550  Parameters:
19551  index - Identifier for the device instance to be configured
19552  channel - Identifier for the Ports channel A, B, C, etc.
19553  bitPos - Possible values of PORTS_BIT_POS
19554  Returns:
19555  Port pin read data.
19556  Example:
19557  <code>
19558  // read port pin RC4
19559  bool bitStatus = PLIB_PORTS_PinGet(PORTS_ID_0, PORT_CHANNEL_C,
19560  PORTS_BIT_POS_4);
19561  </code>
19562  Remarks:
19563  For reading the Latched data, PLIB_PORTS_PinGetLatched function should be used.
19564 
19565  This feature may not be available on all devices. Please refer to the
19566  specific device data sheet to determine availability or use
19567  PLIB_PORTS_ExistsPortsRead in your application to determine whether
19568  this feature is available.
19569 */
19570 
19571 bool
19573  PORTS_MODULE_ID index ,
19574  PORTS_CHANNEL channel ,
19575  PORTS_BIT_POS bitPos ) ;
19576 // *****************************************************************************
19577 /* Function:
19578  bool PLIB_PORTS_PinGetLatched( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
19579  PORTS_BIT_POS bitPos )
19580  Summary:
19581  Reads/Gets data from the selected latch.
19582  Description:
19583  This function reads/gets data from the selected PORTx Data Latch, not from
19584  the port I/O pins.
19585  This function does not perform atomic register access.
19586 
19587  Precondition:
19588  None.
19589  Parameters:
19590  index - Identifier for the device instance to be configured
19591  channel - Identifier for the Ports channel A, B, C, etc.
19592  bitPos - Possible values of PORTS_BIT_POS
19593  Returns:
19594  Latch read data.
19595  Example:
19596  <code>
19597  // read latch RC4
19598  bool bitStatus = PLIB_PORTS_PinGetLatched(PORTS_ID_0, PORT_CHANNEL_C,
19599  PORTS_BIT_POS_4);
19600  </code>
19601  Remarks:
19602  For reading the Live data from the i/o pin, PLIB_PORTS_PinGet function
19603  should be used.
19604 
19605  This feature may not be available on all devices. Please refer to the
19606  specific device data sheet to determine availability or use
19607  PLIB_PORTS_ExistsLatchRead in your application to determine whether
19608  this feature is available.
19609 */
19610 
19611 bool
19613  PORTS_MODULE_ID index ,
19614  PORTS_CHANNEL channel ,
19615  PORTS_BIT_POS bitPos ) ;
19616 // *****************************************************************************
19617 /* Function:
19618  void PLIB_PORTS_PinWrite( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
19619  PORTS_BIT_POS bitPos,
19620  bool value )
19621  Summary:
19622  Writes the selected digital pin/latch.
19623  Description:
19624  This function writes to the selected digital pin/latch.
19625  This function does not perform atomic register access.
19626  Precondition:
19627  None.
19628  Parameters:
19629  index - Identifier for the device instance to be configured
19630  channel - Identifier for the Ports channel A, B, C, etc.
19631  bitPos - Possible values of PORTS_BIT_POS
19632  value - Value to be written to the specific pin/latch
19633  true - sets the bit, false - clears the bit
19634  Returns:
19635  None.
19636  Example:
19637  <code>
19638 
19639  // write 'one' in port RC4
19640  PLIB_PORTS_PinWrite(PORTS_ID_0, PORT_CHANNEL_C, PORTS_BIT_POS_4, 1);
19641 
19642  </code>
19643  Remarks:
19644  This feature may not be available on all devices. Please refer to the
19645  specific device data sheet to determine availability or use
19646  PLIB_PORTS_ExistsPortsWrite in your application to determine whether
19647  this feature is available.
19648 */
19649 
19650 void
19652  PORTS_MODULE_ID index ,
19653  PORTS_CHANNEL channel ,
19654  PORTS_BIT_POS bitPos ,
19655  bool value ) ;
19656 // *****************************************************************************
19657 /* Function:
19658  void PLIB_PORTS_PinSet( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
19659  PORTS_BIT_POS bitPos )
19660  Summary:
19661  Sets the selected digital pin/latch.
19662  Description:
19663  This function sets the selected digital pin/latch.
19664  This function does not perform atomic register access.
19665  Precondition:
19666  None.
19667  Parameters:
19668  index - Identifier for the device instance to be configured
19669  channel - Identifier for the Ports channel A, B, C, etc.
19670  bitPos - Possible values of PORTS_BIT_POS
19671  Returns:
19672  None.
19673  Example:
19674  <code>
19675 
19676  // Sets port pin RC4
19677  PLIB_PORTS_PinSet(PORTS_ID_0, PORT_CHANNEL_C, PORTS_BIT_POS_4);
19678 
19679  </code>
19680  Remarks:
19681  This feature may not be available on all devices. Please refer to the
19682  specific device data sheet to determine availability or use
19683  PLIB_PORTS_ExistsPortsWrite in your application to determine whether
19684  this feature is available.
19685 */
19686 
19687 void
19689  PORTS_MODULE_ID index ,
19690  PORTS_CHANNEL channel ,
19691  PORTS_BIT_POS bitPos ) ;
19692 // *****************************************************************************
19693 /* Function:
19694  void PLIB_PORTS_PinClear( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
19695  PORTS_BIT_POS bitPos )
19696  Summary:
19697  Clears the selected digital pin/latch.
19698  Description:
19699  This function clears the selected digital pin/latch.
19700  This function does not perform atomic register access.
19701  Precondition:
19702  None.
19703  Parameters:
19704  index - Identifier for the device instance to be configured
19705  channel - Identifier for the Ports channel A, B, C, etc.
19706  bitPos - Possible values of PORTS_BIT_POS
19707  Returns:
19708  None.
19709  Example:
19710  <code>
19711 
19712  // Clears port pin RC4
19713  PLIB_PORTS_PinClear(PORTS_ID_0, PORT_CHANNEL_C, PORTS_BIT_POS_4);
19714 
19715  </code>
19716  Remarks:
19717  This feature may not be available on all devices. Please refer to the
19718  specific device data sheet to determine availability or use
19719  PLIB_PORTS_ExistsPortsWrite in your application to determine whether
19720  this feature is available.
19721 */
19722 
19723 void
19725  PORTS_MODULE_ID index ,
19726  PORTS_CHANNEL channel ,
19727  PORTS_BIT_POS bitPos ) ;
19728 // *****************************************************************************
19729 /* Function:
19730  void PLIB_PORTS_PinToggle( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
19731  PORTS_BIT_POS bitPos )
19732  Summary:
19733  Toggles the selected digital pin/latch.
19734  Description:
19735  This function toggles the selected digital pin/latch.
19736  This function does not perform atomic register access.
19737  Precondition:
19738  None.
19739  Parameters:
19740  index - Identifier for the device instance to be configured
19741  channel - Identifier for the Ports channel A, B, C, etc.
19742  bitPos - Possible values of PORTS_BIT_POS
19743  Returns:
19744  None.
19745  Example:
19746  <code>
19747 
19748  // Toggles port pin RC4
19749  PLIB_PORTS_PinToggle(PORTS_ID_0, PORT_CHANNEL_C, PORTS_BIT_POS_4);
19750 
19751  </code>
19752  Remarks:
19753  This feature may not be available on all devices. Please refer to the
19754  specific device data sheet to determine availability or use
19755  PLIB_PORTS_ExistsPortsWrite in your application to determine whether
19756  this feature is available.
19757 */
19758 
19759 void
19761  PORTS_MODULE_ID index ,
19762  PORTS_CHANNEL channel ,
19763  PORTS_BIT_POS bitPos ) ;
19764 // *****************************************************************************
19765 /* Function:
19766  void PLIB_PORTS_PinDirectionInputSet( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
19767  PORTS_BIT_POS bitPos )
19768  Summary:
19769  Makes the selected pin direction input
19770  Description:
19771  This function makes the selected pin direction as input
19772  This function does not perform atomic register access.
19773  Precondition:
19774  None.
19775  Parameters:
19776  index - Identifier for the device instance to be configured
19777  channel - Identifier for the Ports channel A, B, C, etc.
19778  bitPos - Possible values of PORTS_BIT_POS direction that has to
19779  be made input
19780  Returns:
19781  None.
19782  Example:
19783  <code>
19784 
19785  // make pin RC4 as input
19786  PLIB_PORTS_PinDirectionInputSet(PORTS_ID_0, PORT_CHANNEL_C, PORTS_BIT_POS_4);
19787 
19788  </code>
19789  Remarks:
19790  This feature may not be available on all devices. Please refer to the
19791  specific device data sheet to determine availability or use
19792  PLIB_PORTS_ExistsPortsDirection in your application to determine whether
19793  this feature is available.
19794 */
19795 
19796 void
19798  PORTS_MODULE_ID index ,
19799  PORTS_CHANNEL channel ,
19800  PORTS_BIT_POS bitPos ) ;
19801 // *****************************************************************************
19802 /* Function:
19803  void PLIB_PORTS_PinDirectionOutputSet( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
19804  PORTS_BIT_POS bitPos )
19805  Summary:
19806  Makes the selected pin direction output
19807  Description:
19808  This function makes the selected pin direction as output
19809  This function does not perform atomic register access.
19810  Precondition:
19811  None.
19812  Parameters:
19813  index - Identifier for the device instance to be configured
19814  channel - Identifier for the Ports channel A, B, C, etc.
19815  bitPos - Possible values of PORTS_BIT_POS direction that has to
19816  be made output
19817  Returns:
19818  None.
19819  Example:
19820  <code>
19821 
19822  // make pin RC4 as output
19823  PLIB_PORTS_PinDirectionOutputSet(PORTS_ID_0, PORT_CHANNEL_C, PORTS_BIT_POS_4);
19824 
19825  </code>
19826  Remarks:
19827  This feature may not be available on all devices. Please refer to the
19828  specific device data sheet to determine availability or use
19829  PLIB_PORTS_ExistsPortsDirection in your application to determine whether
19830  this feature is available.
19831 */
19832 
19833 void
19835  PORTS_MODULE_ID index ,
19836  PORTS_CHANNEL channel ,
19837  PORTS_BIT_POS bitPos ) ;
19838 // *****************************************************************************
19839 /* Function:
19840  void PLIB_PORTS_PinOpenDrainEnable( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
19841  PORTS_BIT_POS bitPos )
19842  Summary:
19843  Enables the open drain functionality for the selected pin.
19844  Description:
19845  This function enables the open drain functionality for the selected pin.
19846  This function does not perform atomic register access.
19847  Precondition:
19848  None.
19849  Parameters:
19850  index - Identifier for the device instance to be configured
19851  channel - Identifier for the Ports channel A, B, C, etc.
19852  bitPos - Possible values of PORTS_BIT_POS
19853  Returns:
19854  None.
19855  Example:
19856  <code>
19857 
19858  // Enable open drain for pin RC4
19859  PLIB_PORTS_PinOpenDrainEnable(PORTS_ID_0, PORT_CHANNEL_C, PORTS_BIT_POS_4);
19860 
19861  </code>
19862  Remarks:
19863  This feature may not be available on all devices. Please refer to the
19864  specific device data sheet to determine availability or use
19865  PLIB_PORTS_ExistsPortsOpenDrain in your application to determine whether
19866  this feature is available.
19867 */
19868 
19869 void
19871  PORTS_MODULE_ID index ,
19872  PORTS_CHANNEL channel ,
19873  PORTS_BIT_POS bitPos ) ;
19874 // *****************************************************************************
19875 /* Function:
19876  void PLIB_PORTS_PinOpenDrainDisable( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
19877  PORTS_BIT_POS bitPos )
19878  Summary:
19879  Disables the open drain functionality for the selected pin.
19880  Description:
19881  This function disables the open drain functionality for the selected pin.
19882  This function does not perform atomic register access.
19883  Precondition:
19884  None.
19885  Parameters:
19886  index - Identifier for the device instance to be configured
19887  channel - Identifier for the Ports channel A, B, C, etc.
19888  bitPos - One of the possible values of PORTS_BIT_POS.
19889  Returns:
19890  None.
19891  Example:
19892  <code>
19893 
19894  // Disable open drain for pin RC4
19895  PLIB_PORTS_PinOpenDrainDisable(PORTS_ID_0, PORT_CHANNEL_C, PORTS_BIT_POS_4);
19896 
19897  </code>
19898  Remarks:
19899  This feature may not be available on all devices. Please refer to the
19900  specific device data sheet to determine availability or use
19901  PLIB_PORTS_ExistsPortsOpenDrain in your application to determine whether
19902  this feature is available.
19903 */
19904 
19905 void
19907  PORTS_MODULE_ID index ,
19908  PORTS_CHANNEL channel ,
19909  PORTS_BIT_POS bitPos ) ;
19910 // *****************************************************************************
19911 /* Function:
19912  PORTS_DATA_TYPE PLIB_PORTS_ReadLatched
19913  (
19914  PORTS_MODULE_ID index,
19915  PORTS_CHANNEL channel
19916  )
19917  Summary:
19918  Reads and returns data from the selected Latch.
19919  Description:
19920  This function reads and returns the data from the selected Latch.
19921  This function does not perform atomic register access.
19922 
19923  Precondition:
19924  None.
19925  Parameters:
19926  index - Identifier for the device instance to be configured
19927  channel - Identifier for the Ports channel A, B, C, etc.
19928  Returns:
19929  Latch read data.
19930  Example:
19931  <code>
19932  // Read latch C
19933  PORTS_DATA_TYPE bitStatus = PLIB_PORTS_ReadLatched(PORTS_ID_0, PORT_CHANNEL_C);
19934 
19935  </code>
19936  Remarks:
19937  For reading the Live data, PLIB_PORTS_Read function should be used.
19938 
19939  This feature may not be available on all devices. Please refer to the
19940  specific device data sheet to determine availability or use
19941  PLIB_PORTS_ExistsLatchRead in your application to determine whether
19942  this feature is available.
19943 */
19944 
19947  PORTS_MODULE_ID index ,
19948  PORTS_CHANNEL channel ) ;
19949 // *****************************************************************************
19950 /* Function:
19951  PORTS_DATA_TYPE PLIB_PORTS_Read( PORTS_MODULE_ID index, PORTS_CHANNEL channel )
19952  Summary:
19953  Reads the selected digital port.
19954  Description:
19955  This function reads from the selected digital port.
19956  This function does not perform atomic register access.
19957  Precondition:
19958  None.
19959  Parameters:
19960  index - Identifier for the device instance to be configured
19961  channel - Identifier for the Ports channel A, B, C, etc.
19962  Returns:
19963  data on a port with width PORTS_DATA_TYPE
19964  Example:
19965  <code>
19966 
19967  // Read PORT C
19968  PORTS_DATA_TYPE readData = PLIB_PORTS_Read(PORTS_ID_0, PORT_CHANNEL_C);
19969 
19970  </code>
19971  Remarks:
19972  For reading the Latched data, PLIB_PORTS_ReadLatched function should be used.
19973 
19974  This feature may not be available on all devices. Please refer to the
19975  specific device data sheet to determine availability or use
19976  PLIB_PORTS_ExistsPortsRead in your application to determine whether
19977  this feature is available.
19978 */
19979 
19981  PLIB_PORTS_Read (
19982  PORTS_MODULE_ID index ,
19983  PORTS_CHANNEL channel ) ;
19984 // *****************************************************************************
19985 /* Function:
19986  void PLIB_PORTS_Write( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
19987  PORTS_DATA_TYPE value )
19988  Summary:
19989  Writes the selected digital port/latch.
19990  Description:
19991  This function writes to the selected digital port/latch.
19992  This function does not perform atomic register access.
19993  Precondition:
19994  None.
19995  Parameters:
19996  index - Identifier for the device instance to be configured
19997  channel - Identifier for the Ports channel A, B, C, etc.
19998  value - Value to be written into a port of width PORTS_DATA_TYPE
19999  Returns:
20000  None.
20001  Example:
20002  <code>
20003 
20004  // Write 0x12 into PORT C
20005  PLIB_PORTS_Write(PORTS_ID_0, PORT_CHANNEL_C, 0x12);
20006 
20007  </code>
20008  Remarks:
20009  This feature may not be available on all devices. Please refer to the
20010  specific device data sheet to determine availability or use
20011  PLIB_PORTS_ExistsPortsWrite in your application to determine whether
20012  this feature is available.
20013 */
20014 
20015 void
20017  PORTS_MODULE_ID index ,
20018  PORTS_CHANNEL channel ,
20019  PORTS_DATA_TYPE value ) ;
20020 // *****************************************************************************
20021 /* Function:
20022  void PLIB_PORTS_Set( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
20023  PORTS_DATA_TYPE value,
20024  PORTS_DATA_MASK mask )
20025  Summary:
20026  Sets the selected bits of the port.
20027  Description:
20028  This function performs an 'AND' operation on the value and mask parameters,
20029  and then sets the bits in the port channel that were set by the result of the
20030  'AND' operation.
20031  This function does not perform atomic register access.
20032  Precondition:
20033  None.
20034  Parameters:
20035  index - Identifier for the device instance to be configured
20036  channel - Identifier for the Ports channel A, B, C, etc.
20037  value - Consists of information about which port bit has to be
20038  set and which not
20039  mask - Identifies the bits which could be intended for setting
20040  Returns:
20041  None.
20042  Example:
20043  <code>
20044 
20045  // MY_VALUE - 0x1234
20046  PORTS_DATA_MASK myMask = (PORTS_DATA_MASK)0x00FF;
20047 
20048  // Set the PORT C bit positions 2,4 and 5 (0x0034 = b0000 0000 0011 0100)
20049  PLIB_PORTS_Set(MY_PORTS_INSTANCE, PORT_CHANNEL_C, MY_VALUE, myMask);
20050 
20051  </code>
20052  Remarks:
20053  This feature may not be available on all devices. Please refer to the
20054  specific device data sheet to determine availability or use
20055  PLIB_PORTS_ExistsPortsWrite in your application to determine whether
20056  this feature is available.
20057 */
20058 
20059 void
20060  PLIB_PORTS_Set (
20061  PORTS_MODULE_ID index ,
20062  PORTS_CHANNEL channel ,
20063  PORTS_DATA_TYPE value ,
20064  PORTS_DATA_MASK mask ) ;
20065 // *****************************************************************************
20066 /* Function:
20067  void PLIB_PORTS_Toggle( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
20068  PORTS_DATA_MASK toggleMask )
20069  Summary:
20070  Toggles the selected digital port/latch.
20071  Description:
20072  This function toggles the selected digital port/latch.
20073  This function does not perform atomic register access.
20074  Precondition:
20075  None.
20076  Parameters:
20077  index - Identifier for the device instance to be configured
20078  channel - Identifier for the Ports channel A, B, C, etc.
20079  toggleMask - Identifies the bits to be toggled
20080  Returns:
20081  None.
20082  Example:
20083  <code>
20084 
20085  // Toggles the three least significant Port C bits
20086  PLIB_PORTS_Toggle(PORTS_ID_0, PORT_CHANNEL_C, 0x0007);
20087 
20088  </code>
20089  Remarks:
20090  This feature may not be available on all devices. Please refer to the
20091  specific device data sheet to determine availability or use
20092  PLIB_PORTS_ExistsPortsWrite in your application to determine whether
20093  this feature is available.
20094 */
20095 
20096 void
20098  PORTS_MODULE_ID index ,
20099  PORTS_CHANNEL channel ,
20100  PORTS_DATA_MASK toggleMask ) ;
20101 // *****************************************************************************
20102 /* Function:
20103  void PLIB_PORTS_Clear( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
20104  PORTS_DATA_MASK clearMask )
20105  Summary:
20106  Clears the selected digital port/latch bits.
20107  Description:
20108  This function clears the selected digital port/latch bits.
20109  This function does not perform atomic register access.
20110  Precondition:
20111  None.
20112  Parameters:
20113  index - Identifier for the device instance to be configured
20114  channel - Identifier for the Ports channel A, B, C, etc.
20115  clearMask - Identifies the bits to be cleared
20116  Returns:
20117  None.
20118  Example:
20119  <code>
20120 
20121  // Clears the three least significant Port C bits
20122  PLIB_PORTS_Clear(PORTS_ID_0, PORT_CHANNEL_C, 0x0007);
20123 
20124  </code>
20125  Remarks:
20126  This feature may not be available on all devices. Please refer to the
20127  specific device data sheet to determine availability or use
20128  PLIB_PORTS_ExistsPortsWrite in your application to determine whether
20129  this feature is available.
20130 */
20131 
20132 void
20134  PORTS_MODULE_ID index ,
20135  PORTS_CHANNEL channel ,
20136  PORTS_DATA_MASK clearMask ) ;
20137 // *****************************************************************************
20138 /* Function:
20139  void PLIB_PORTS_DirectionInputSet( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
20140  PORTS_DATA_MASK mask )
20141  Summary:
20142  Makes the selected pins direction input.
20143  Description:
20144  This function makes the selected pins direction input.
20145  This function does not perform atomic register access.
20146 
20147  Precondition:
20148  None.
20149  Parameters:
20150  index - Identifier for the device instance to be configured
20151  channel - Identifier for the Ports channel A, B, C, etc.
20152  mask - Identifies the pins direction that has to be made input
20153  Returns:
20154  None.
20155  Example:
20156  <code>
20157 
20158  // Make RC0, RC1 and RC2 pins as Input
20159  PLIB_PORTS_DirectionInputSet(PORTS_ID_0, PORT_CHANNEL_C, 0x0007);
20160 
20161  </code>
20162  Remarks:
20163  This feature may not be available on all devices. Please refer to the
20164  specific device data sheet to determine availability or use
20165  PLIB_PORTS_ExistsPortsDirection in your application to determine whether
20166  this feature is available.
20167 */
20168 
20169 void
20171  PORTS_MODULE_ID index ,
20172  PORTS_CHANNEL channel ,
20173  PORTS_DATA_MASK mask ) ;
20174 // *****************************************************************************
20175 /* Function:
20176  void PLIB_PORTS_DirectionOutputSet( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
20177  PORTS_DATA_MASK mask )
20178  Summary:
20179  Makes the selected pins direction output.
20180  Description:
20181  This function makes the selected pins direction output.
20182  This function does not perform atomic register access.
20183  Precondition:
20184  None.
20185  Parameters:
20186  index - Identifier for the device instance to be configured
20187  channel - Identifier for the Ports channel A, B, C, etc.
20188  mask - Identifies the pins direction that has to be made output
20189  Returns:
20190  None.
20191  Example:
20192  <code>
20193 
20194  // Make RC0, RC1 and RC2 pins as Output
20195  PLIB_PORTS_DirectionOutputSet(PORTS_ID_0, PORT_CHANNEL_C, 0x0007);
20196 
20197  </code>
20198  Remarks:
20199  This feature may not be available on all devices. Please refer to the
20200  specific device data sheet to determine availability or use
20201  PLIB_PORTS_ExistsPortsDirection in your application to determine whether
20202  this feature is available.
20203 */
20204 
20205 void
20207  PORTS_MODULE_ID index ,
20208  PORTS_CHANNEL channel ,
20209  PORTS_DATA_MASK mask ) ;
20210 // *****************************************************************************
20211 /* Function:
20212  PORTS_DATA_MASK PLIB_PORTS_DirectionGet( PORTS_MODULE_ID index, PORTS_CHANNEL channel )
20213  Summary:
20214  Reads the direction of the selected digital port.
20215  Description:
20216  This function reads the direction of the selected digital port.
20217  This function does not perform atomic register access.
20218  Precondition:
20219  None.
20220  Parameters:
20221  index - Identifier for the device instance to be configured
20222  channel - Identifier for the Ports channel A, B, C, etc.
20223  Returns:
20224  Direction of the selected port of type PORTS_DATA_MASK
20225  Example:
20226  <code>
20227 
20228  // Reads the direction of Port C pins
20229  PORTS_DATA_MASK readDir = PLIB_PORTS_DirectionGet(PORTS_ID_0, PORT_CHANNEL_C);
20230 
20231  </code>
20232  Remarks:
20233  This feature may not be available on all devices. Please refer to the
20234  specific device data sheet to determine availability or use
20235  PLIB_PORTS_ExistsPortsDirection in your application to determine whether
20236  this feature is available.
20237 */
20238 
20241  PORTS_MODULE_ID index ,
20242  PORTS_CHANNEL channel ) ;
20243 // *****************************************************************************
20244 /* Function:
20245  void PLIB_PORTS_OpenDrainEnable( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
20246  PORTS_DATA_MASK mask )
20247  Summary:
20248  Enables the open drain functionality for the selected port pins.
20249  Description:
20250  This function enables the open drain functionality for the selected port pins.
20251  This function does not perform atomic register access.
20252  Precondition:
20253  None.
20254  Parameters:
20255  index - Identifier for the device instance to be configured
20256  channel - Identifier for the Ports channel A, B, C, etc.
20257  mask - Identifies the pins for the open drain to be enabled
20258  Returns:
20259  None.
20260  Example:
20261  <code>
20262 
20263  // Enable Open Drain for RC0, RC1 and RC2 pins
20264  PLIB_PORTS_OpenDrainEnable(PORTS_ID_0, PORT_CHANNEL_C, 0x0007);
20265 
20266  </code>
20267  Remarks:
20268  This feature may not be available on all devices. Please refer to the
20269  specific device data sheet to determine availability or use
20270  PLIB_PORTS_ExistsPortsOpenDrain in your application to determine whether
20271  this feature is available.
20272 */
20273 
20274 void
20276  PORTS_MODULE_ID index ,
20277  PORTS_CHANNEL channel ,
20278  PORTS_DATA_MASK mask ) ;
20279 // *****************************************************************************
20280 /* Function:
20281  void PLIB_PORTS_OpenDrainDisable( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
20282  PORTS_DATA_MASK mask )
20283  Summary:
20284  Disables the open drain functionality for the selected port.
20285  Description:
20286  This function disables the open drain functionality for the selected port.
20287  This function does not perform atomic register access.
20288 
20289  Precondition:
20290  None.
20291  Parameters:
20292  index - Identifier for the device instance to be configured
20293  channel - Identifier for the Ports channel A, B, C, etc.
20294  mask - Identifies the pins for the open drain to be disabled
20295  Returns:
20296  None.
20297  Example:
20298  <code>
20299 
20300  // Disable Open Drain for RC0, RC1 and RC2 pins
20301  PLIB_PORTS_OpenDrainDisable(PORTS_ID_0, PORT_CHANNEL_C, 0x0007);
20302 
20303  </code>
20304  Remarks:
20305  This feature may not be available on all devices. Please refer to the
20306  specific device data sheet to determine availability or use
20307  PLIB_PORTS_ExistsPortsOpenDrain in your application to determine whether
20308  this feature is available.
20309 */
20310 
20311 void
20313  PORTS_MODULE_ID index ,
20314  PORTS_CHANNEL channel ,
20315  PORTS_DATA_MASK mask ) ;
20316 // *****************************************************************************
20317 /* Function:
20318  void PLIB_PORTS_ChannelModeSelect
20319  (
20320  PORTS_MODULE_ID index,
20321  PORTS_CHANNEL channel,
20322  PORTS_DATA_MASK modeMask,
20323  PORTS_PIN_MODE mode
20324  );
20325  Summary:
20326  Enables the selected channel pins as analog or digital.
20327  Description:
20328  This function enables the selected channel pins as analog or digital.
20329  This function does not perform atomic register access.
20330  Precondition:
20331  None.
20332  Parameters:
20333  index - Identifier for the device instance to be configured
20334  channel - Port pin channel
20335  modeMask - Identifies the pins whose mode has to be modified.
20336  Modes of the pins whose corresponding bit is '1' get
20337  modified, mode of the other pins remains the same.
20338  mode - Possible values of PORTS_PIN_MODE (Analog or Digital)
20339  Returns:
20340  None.
20341  Example:
20342  <code>
20343 
20344  // Make pins RC5, RC8 and RC13 Analog
20345  PLIB_PORTS_ChannelModeSelect(PORTS_ID_0, PORT_CHANNEL_C, 0x2120, PORTS_PIN_MODE_ANALOG);
20346 
20347  </code>
20348  Remarks:
20349  This function is only available in devices with PPS. For Non-PPS devices, use the
20350  PLIB_PORTS_AnPinsModeSelect function.
20351 
20352  This feature may not be available on all devices. Please refer to the
20353  specific device data sheet to determine availability or use
20354  PLIB_PORTS_ExistsPinModePerPort in your application to determine whether
20355  this feature is available.
20356 */
20357 
20358 void
20360  PORTS_MODULE_ID index ,
20361  PORTS_CHANNEL channel ,
20362  PORTS_DATA_MASK modeMask ,
20363  PORTS_PIN_MODE mode ) ;
20364 // *****************************************************************************
20365 /* Function:
20366  void PLIB_PORTS_ChannelChangeNoticePullUpEnable
20367  (
20368  PORTS_MODULE_ID index,
20369  PORTS_CHANNEL channel,
20370  PORTS_DATA_MASK mask
20371  );
20372  Summary:
20373  Enables Change Notice pull-up for the selected channel pins.
20374  Description:
20375  This function enables the Change Notice pull-up for the selected
20376  channel pins.
20377  This function does not perform atomic register access.
20378  Precondition:
20379  None.
20380  Parameters:
20381  index - Identifier for the device instance to be configured
20382  channel - Port pin channel
20383  mask - Identifies the pins of the pull-up to be enabled
20384  Returns:
20385  None.
20386  Example:
20387  <code>
20388 
20389  // Enable pull-up for RC5, RC8 and RC13 pins
20390  PLIB_PORTS_ChannelChangeNoticePullUpEnable(PORTS_ID_0, PORT_CHANNEL_C,
20391  0x2120);
20392  </code>
20393  Remarks:
20394  This function is only available in devices with PPS. For Non-PPS devices, use the
20395  PLIB_PORTS_CnPinsPullUpEnable function.
20396 
20397  This feature may not be available on all devices. Please refer to the
20398  specific device data sheet to determine availability or use
20399  PLIB_PORTS_ExistsChangeNoticePullUpPerPort in your application to
20400  determine whether this feature is available.
20401 */
20402 
20403 void
20405  PORTS_MODULE_ID index ,
20406  PORTS_CHANNEL channel ,
20407  PORTS_DATA_MASK mask ) ;
20408 // *****************************************************************************
20409 /* Function:
20410  void PLIB_PORTS_ChannelChangeNoticePullUpDisable
20411  (
20412  PORTS_MODULE_ID index,
20413  PORTS_CHANNEL channel,
20414  PORTS_DATA_MASK mask
20415  );
20416  Summary:
20417  Disables Change Notice pull-up for the selected channel pins.
20418  Description:
20419  This function Disables the Change Notice pull-up for the selected
20420  channel pins.
20421  PLIB_PORTS_ChannelChangeNoticePullUpDisable
20422  Precondition:
20423  None.
20424  Parameters:
20425  index - Identifier for the device instance to be configured
20426  channel - Port pin channel
20427  mask - Identifies the pins of the pull-up to be disabled
20428  Returns:
20429  None.
20430  Example:
20431  <code>
20432 
20433  // Disable pull-up for RC5, RC8 and RC13 pins
20434  PLIB_PORTS_ChannelChangeNoticePullUpDisable(PORTS_ID_0, PORT_CHANNEL_C,
20435  0x2120);
20436  </code>
20437  Remarks:
20438  This function is only available in devices with PPS. For Non-PPS devices, use the
20439  PLIB_PORTS_CnPinsPullUpDisable function.
20440 
20441  This feature may not be available on all devices. Please refer to the
20442  specific device data sheet to determine availability or use
20443  PLIB_PORTS_ExistsChangeNoticePullUpPerPort in your application to
20444  determine whether this feature is available.
20445 */
20446 
20447 void
20449  PORTS_MODULE_ID index ,
20450  PORTS_CHANNEL channel ,
20451  PORTS_DATA_MASK mask ) ;
20452 // *****************************************************************************
20453 /* Function:
20454  void PLIB_PORTS_ChannelChangeNoticePullDownEnable
20455  (
20456  PORTS_MODULE_ID index,
20457  PORTS_CHANNEL channel,
20458  PORTS_DATA_MASK mask
20459  );
20460  Summary:
20461  Enables Change Notice pull-down for the selected channel pins.
20462  Description:
20463  This function enables the Change Notice pull-down for the selected
20464  channel pins.
20465  This function does not perform atomic register access.
20466  Precondition:
20467  None.
20468  Parameters:
20469  index - Identifier for the device instance to be configured
20470  channel - Port pin channel
20471  mask - Identifies the pins for the pull-down to be enabled
20472  Returns:
20473  None.
20474  Example:
20475  <code>
20476 
20477  // Enable pull-down for RC5, RC8 and RC13 pins
20478  PLIB_PORTS_ChannelChangeNoticePullDownEnable(PORTS_ID_0, PORT_CHANNEL_C,
20479  0x2120);
20480  </code>
20481  Remarks:
20482  This feature may not be available on all devices. Please refer to the
20483  specific device data sheet to determine availability or use
20484  PLIB_PORTS_ExistsChangeNoticePullDownPerPort in your application to
20485  determine whether this feature is available.
20486 */
20487 
20488 void
20490  PORTS_MODULE_ID index ,
20491  PORTS_CHANNEL channel ,
20492  PORTS_DATA_MASK mask ) ;
20493 // *****************************************************************************
20494 /* Function:
20495  void PLIB_PORTS_ChannelChangeNoticePullDownDisable
20496  (
20497  PORTS_MODULE_ID index,
20498  PORTS_CHANNEL channel,
20499  PORTS_DATA_MASK mask
20500  );
20501  Summary:
20502  Disables Change Notice pull-down for the selected channel pins.
20503  Description:
20504  This function Disables the Change Notice pull-down for the selected
20505  channel pins.
20506  This function does not perform atomic register access.
20507  Precondition:
20508  None.
20509  Parameters:
20510  index - Identifier for the device instance to be configured
20511  channel - Port pin channel
20512  mask - Identifies the pins for the pull-down to be disabled
20513  Returns:
20514  None.
20515  Example:
20516  <code>
20517 
20518  // Disable pull-down for RC5, RC8 and RC13 pins
20519  PLIB_PORTS_ChannelChangeNoticePullDownDisable(PORTS_ID_0, PORT_CHANNEL_C,
20520  0x2120);
20521  </code>
20522  Remarks:
20523  This feature may not be available on all devices. Please refer to the
20524  specific device data sheet to determine availability or use
20525  PLIB_PORTS_ExistsChangeNoticePullDownPerPort in your application to
20526  determine whether this feature is available.
20527 */
20528 
20529 void
20531  PORTS_MODULE_ID index ,
20532  PORTS_CHANNEL channel ,
20533  PORTS_DATA_MASK mask ) ;
20534 // *****************************************************************************
20535 /* Function:
20536  void PLIB_PORTS_ChannelChangeNoticeEnable
20537  (
20538  PORTS_MODULE_ID index,
20539  PORTS_CHANNEL channel,
20540  PORTS_DATA_MASK mask
20541  );
20542  Summary:
20543  Enables CN interrupt for the selected pins of a channel.
20544  Description:
20545  This function enables Change Notice interrupt for the selected port
20546  pins of a channel.
20547  This function does not perform atomic register access.
20548  Precondition:
20549  None.
20550  Parameters:
20551  index - Identifier for the device instance to be configured
20552  channel - Port pin channel
20553  mask - Identifies the pins for which change notification is
20554  to be enabled
20555  Returns:
20556  None.
20557  Example:
20558  <code>
20559 
20560  // Enable CN interrupt for RC5, RC8 and RC13 pins
20561  PLIB_PORTS_ChannelChangeNoticeEnable(PORTS_ID_0, PORT_CHANNEL_C, 0x2120);
20562 
20563  </code>
20564  Remarks:
20565  This function is only available in devices with PPS. For Non-PPS devices, use the
20566  PLIB_PORTS_CnPinsEnable function.
20567 
20568  This feature may not be available on all devices. Please refer to the
20569  specific device data sheet to determine availability or use
20570  PLIB_PORTS_ExistsChangeNoticeIntPerPort in your application to
20571  determine whether this feature is available.
20572 */
20573 
20574 void
20576  PORTS_MODULE_ID index ,
20577  PORTS_CHANNEL channel ,
20578  PORTS_DATA_MASK mask ) ;
20579 // *****************************************************************************
20580 /* Function:
20581  void PLIB_PORTS_ChannelChangeNoticeDisable
20582  (
20583  PORTS_MODULE_ID index,
20584  PORTS_CHANNEL channel,
20585  PORTS_DATA_MASK mask
20586  );
20587  Summary:
20588  Disables CN interrupt for the selected pins of a channel.
20589  Description:
20590  This function Disables Change Notice interrupt for the selected port
20591  pins of a channel.
20592  This function does not perform atomic register access.
20593  Precondition:
20594  None.
20595  Parameters:
20596  index - Identifier for the device instance to be configured
20597  channel - Port pin channel
20598  mask - Identifies the pins for which change notification is
20599  to be disabled
20600  Returns:
20601  None.
20602  Example:
20603  <code>
20604 
20605  // Disable CN interrupt for RC5, RC8 and RC13 pins
20606  PLIB_PORTS_ChannelChangeNoticeDisable(PORTS_ID_0, PORT_CHANNEL_C, 0x2120);
20607 
20608  </code>
20609  Remarks:
20610  This function is only available in devices with PPS. For Non-PPS devices, use the
20611  PLIB_PORTS_CnPinsDisable function.
20612 
20613  This feature may not be available on all devices. Please refer to the
20614  specific device data sheet to determine availability or use
20615  PLIB_PORTS_ExistsChangeNoticeIntPerPort in your application to
20616  determine whether this feature is available.
20617 */
20618 
20619 void
20621  PORTS_MODULE_ID index ,
20622  PORTS_CHANNEL channel ,
20623  PORTS_DATA_MASK mask ) ;
20624 // *****************************************************************************
20625 /* Function:
20626  void PLIB_PORTS_AnPinsModeSelect
20627  (
20628  PORTS_MODULE_ID index,
20629  PORTS_AN_PIN anPins,
20630  PORTS_PIN_MODE mode
20631  );
20632  Summary:
20633  Enables the selected AN pins as analog or digital.
20634  Description:
20635  This function enables the selected AN pins as analog or digital.
20636  This function does not perform atomic register access.
20637  Precondition:
20638  None.
20639  Parameters:
20640  index - Identifier for the device instance to be configured
20641  anPins - AN pins whose mode is to be changed. Multiple AN pins
20642  can be ORed.
20643  mode - Possible values of PORTS_PIN_MODE (Analog or Digital)
20644  Returns:
20645  None.
20646  Example:
20647  <code>
20648 
20649  // Make pins AN5, AN8 and AN13 Analog
20650  PLIB_PORTS_AnPinsModeSelect(PORTS_ID_0, PORTS_AN_PIN_5 |
20651  PORTS_AN_PIN_8 |
20652  PORTS_AN_PIN_13,
20653  PORTS_PIN_MODE_ANALOG);
20654 
20655  </code>
20656  Remarks:
20657  This function is only available in devices without PPS feature. For PPS
20658  devices, use the PLIB_PORTS_ChannelModeSelect function.
20659 
20660  This feature may not be available on all devices. Please refer to the
20661  specific device data sheet to determine availability or use
20662  PLIB_PORTS_ExistsAnPinsMode in your application to determine whether
20663  this feature is available.
20664 */
20665 
20666 void
20668  PORTS_MODULE_ID index ,
20669  PORTS_AN_PIN anPins ,
20670  PORTS_PIN_MODE mode ) ;
20671 // *****************************************************************************
20672 /* Function:
20673  void PLIB_PORTS_CnPinsPullUpEnable
20674  (
20675  PORTS_MODULE_ID index,
20676  PORTS_CN_PIN cnPins
20677  );
20678  Summary:
20679  Enables Change Notice pull-up for the selected channel pins.
20680  Description:
20681  This function enables the Change Notice pull-up for the selected
20682  channel pins.
20683  This function performs atomic register access.
20684  Precondition:
20685  None.
20686  Parameters:
20687  index - Identifier for the device instance to be configured
20688  cnPins - CN pins whose pull-up is to be enabled. Multiple CN pins
20689  can be ORed.
20690  Returns:
20691  None.
20692  Example:
20693  <code>
20694 
20695  // Enable pull-up for CN5, CN8 and CN13 pins
20696  PLIB_PORTS_CnPinsPullUpEnable(PORTS_ID_0, CHANGE_NOTICE_PIN_5 |
20697  CHANGE_NOTICE_PIN_8 |
20698  CHANGE_NOTICE_PIN_13);
20699 
20700  </code>
20701  Remarks:
20702  This function is only available in devices without PPS feature. For PPS
20703  devices, use the PLIB_PORTS_ChannelChangeNoticePullUpEnable function.
20704 
20705  This feature may not be available on all devices. Please refer to the
20706  specific device data sheet to determine availability or use
20707  PLIB_PORTS_ExistsChangeNoticePullUp in your application to
20708  determine whether this feature is available.
20709 */
20710 
20711 void
20713  PORTS_MODULE_ID index ,
20714  PORTS_CN_PIN cnPins ) ;
20715 // *****************************************************************************
20716 /* Function:
20717  void PLIB_PORTS_CnPinsPullUpDisable
20718  (
20719  PORTS_MODULE_ID index,
20720  PORTS_CN_PIN cnPins
20721  );
20722  Summary:
20723  Disables Change Notice pull-up for the selected channel pins.
20724  Description:
20725  This function Disables the Change Notice pull-up for the selected
20726  channel pins.
20727  This function performs atomic register access.
20728  Precondition:
20729  None.
20730  Parameters:
20731  index - Identifier for the device instance to be configured
20732  cnPins - CN pins whose pull-up is to be disabled. Multiple CN pins
20733  can be ORed.
20734  Returns:
20735  None.
20736  Example:
20737  <code>
20738 
20739  // Disable pull-up for CN5, CN8 and CN13 pins
20740  PLIB_PORTS_CnPinsPullUpDisable(PORTS_ID_0,
20741  CHANGE_NOTICE_PIN_5 |
20742  CHANGE_NOTICE_PIN_8 |
20743  CHANGE_NOTICE_PIN_13);
20744 
20745  </code>
20746  Remarks:
20747  This function is only available in devices without PPS feature. For PPS
20748  devices, use the PLIB_PORTS_ChannelChangeNoticePullUpDisable function.
20749 
20750  This feature may not be available on all devices. Please refer to the
20751  specific device data sheet to determine availability or use
20752  PLIB_PORTS_ExistsChangeNoticePullUp in your application to
20753  determine whether this feature is available.
20754 */
20755 
20756 void
20758  PORTS_MODULE_ID index ,
20759  PORTS_CN_PIN cnPins ) ;
20760 // *****************************************************************************
20761 /* Function:
20762  void PLIB_PORTS_CnPinsEnable
20763  (
20764  PORTS_MODULE_ID index,
20765  PORTS_CN_PIN cnPins
20766  );
20767  Summary:
20768  Enables CN interrupt for the selected pins of a channel.
20769  Description:
20770  This function enables Change Notice interrupt for the selected port
20771  pins of a channel.
20772  This function performs atomic register access.
20773  Precondition:
20774  None.
20775  Parameters:
20776  index - Identifier for the device instance to be configured
20777  cnPins - CN pins to be enabled. Multiple CN pins can be ORed.
20778  Returns:
20779  None.
20780  Example:
20781  <code>
20782 
20783  // Enable CN interrupt for CN5, CN8 and CN13 pins
20784  PLIB_PORTS_CnPinsEnable(PORTS_ID_0,
20785  CHANGE_NOTICE_PIN_5 |
20786  CHANGE_NOTICE_PIN_8 |
20787  CHANGE_NOTICE_PIN_13);
20788 
20789  </code>
20790  Remarks:
20791  This function is only available in devices without PPS feature. For PPS
20792  devices, use the PLIB_PORTS_ChannelChangeNoticeEnable function.
20793 
20794  This feature may not be available on all devices. Please refer to the
20795  specific device data sheet to determine availability or use
20796  PLIB_PORTS_ExistsPinChangeNotice in your application to
20797  determine whether this feature is available.
20798 */
20799 
20800 void
20802  PORTS_MODULE_ID index ,
20803  PORTS_CN_PIN cnPins ) ;
20804 // *****************************************************************************
20805 /* Function:
20806  void PLIB_PORTS_CnPinsDisable
20807  (
20808  PORTS_MODULE_ID index,
20809  PORTS_CN_PIN cnPins
20810  );
20811  Summary:
20812  Disables CN interrupt for the selected pins of a channel.
20813  Description:
20814  This function Disables Change Notice interrupt for the selected port
20815  pins of a channel.
20816  This function performs atomic register access.
20817  Precondition:
20818  None.
20819  Parameters:
20820  index - Identifier for the device instance to be configured
20821  cnPins - CN pins to be disabled. Multiple CN pins can be ORed.
20822  Returns:
20823  None.
20824  Example:
20825  <code>
20826 
20827  // Disable CN interrupt for CN5, CN8 and CN13 pins
20828  PLIB_PORTS_CnPinsDisable(PORTS_ID_0,
20829  CHANGE_NOTICE_PIN_5 |
20830  CHANGE_NOTICE_PIN_8 |
20831  CHANGE_NOTICE_PIN_13);
20832 
20833  </code>
20834  Remarks:
20835  This function is only available in devices without PPS feature. For PPS
20836  devices, use the PLIB_PORTS_ChannelChangeNoticeDisable function.
20837 
20838  This feature may not be available on all devices. Please refer to the
20839  specific device data sheet to determine availability or use
20840  PLIB_PORTS_ExistsPinChangeNotice in your application to
20841  determine whether this feature is available.
20842 */
20843 
20844 void
20846  PORTS_MODULE_ID index ,
20847  PORTS_CN_PIN cnPins ) ;
20848 // *****************************************************************************
20849 /* Function:
20850  void PLIB_PORTS_ChangeNoticeEnable( PORTS_MODULE_ID index )
20851  Summary:
20852  Global Change Notice enable.
20853  Description:
20854  This function enables the global Change Notice feature.
20855  This function performs atomic register access.
20856  Precondition:
20857  None.
20858  Parameters:
20859  index - Identifier for the device instance to be configured
20860  Returns:
20861  None.
20862  Example:
20863  <code>
20864 
20865  // Enable Change Notification
20866  PLIB_PORTS_ChangeNoticeEnable(PORTS_ID_0);
20867 
20868  </code>
20869  Remarks:
20870  This function is only available in devices without PPS. For PPS devices, use the
20871  PLIB_PORTS_ChangeNoticePerPortTurnOn function.
20872 
20873  This feature may not be available on all devices. Please refer to the
20874  specific device data sheet to determine availability or use
20875  PLIB_PORTS_ExistsChangeNotice in your application to determine whether
20876  this feature is available.
20877 */
20878 
20879 void
20881  PORTS_MODULE_ID index ) ;
20882 // *****************************************************************************
20883 /* Function:
20884  void PLIB_PORTS_ChangeNoticeDisable( PORTS_MODULE_ID index )
20885  Summary:
20886  Global Change Notice disable.
20887  Description:
20888  This function disables the global Change Notice feature.
20889  Precondition:
20890  None.
20891  Parameters:
20892  index - Identifier for the device instance to be configured
20893  Returns:
20894  None.
20895  Example:
20896  <code>
20897 
20898  // Disable Change Notification
20899  PLIB_PORTS_ChangeNoticeDisable(PORTS_ID_0);
20900 
20901  </code>
20902  Remarks:
20903  This function is only available in devices without PPS. For PPS devices, use the
20904  PLIB_PORTS_ChangeNoticePerPortTurnOff function.
20905 
20906  This feature may not be available on all devices. Please refer to the
20907  specific device data sheet to determine availability or use
20908  PLIB_PORTS_ExistsChangeNotice in your application to determine whether
20909  this feature is available.
20910 */
20911 
20912 void
20914  PORTS_MODULE_ID index ) ;
20915 // *****************************************************************************
20916 /* Function:
20917  void PLIB_PORTS_PinChangeNoticeEnable( PORTS_MODULE_ID index,
20918  PORTS_CHANGE_NOTICE_PIN pinNum )
20919  Summary:
20920  Port pin Change Notice interrupt enable.
20921  Description:
20922  This function enables the port pin Change Notice feature.
20923  This function performs atomic register access.
20924  Precondition:
20925  None.
20926  Parameters:
20927  index - Identifier for the device instance to be configured
20928  pinNum - Possible values of PORTS_CHANGE_NOTICE_PIN
20929  Returns:
20930  None.
20931  Example:
20932  <code>
20933 
20934  // Enable Change Notice interrupt for pin CN13
20935  PLIB_PORTS_PinChangeNoticeEnable(PORTS_ID_0, CN13);
20936 
20937  </code>
20938  Remarks:
20939  This function is only available in devices without PPS. For PPS devices, use the
20940  PLIB_PORTS_PinChangeNoticePerPortEnable function.
20941 
20942  This feature may not be available on all devices. Please refer to the
20943  specific device data sheet to determine availability or use
20944  PLIB_PORTS_ExistsPinChangeNotice in your application to determine whether
20945  this feature is available.
20946 */
20947 
20948 void
20950  PORTS_MODULE_ID index ,
20951  PORTS_CHANGE_NOTICE_PIN pinNum ) ;
20952 // *****************************************************************************
20953 /* Function:
20954  void PLIB_PORTS_PinChangeNoticeDisable( PORTS_MODULE_ID index,
20955  PORTS_CHANGE_NOTICE_PIN pinNum )
20956  Summary:
20957  Port pin Change Notice disable.
20958  Description:
20959  This function disables the port pin Change Notice feature.
20960  This function performs atomic register access.
20961  Precondition:
20962  None.
20963  Parameters:
20964  index - Identifier for the device instance to be configured
20965  pinNum - Possible values of PORTS_CHANGE_NOTICE_PIN
20966  Returns:
20967  None.
20968  Example:
20969  <code>
20970 
20971  // Disable Change Notice interrupt for pin CN13
20972  PLIB_PORTS_PinChangeNoticeDisable(PORTS_ID_0, CN13);
20973 
20974  </code>
20975  Remarks:
20976  This function is only available in devices without PPS. For PPS devices, use the
20977  PLIB_PORTS_PinChangeNoticePerPortDisable function.
20978 
20979  This feature may not be available on all devices. Please refer to the
20980  specific device data sheet to determine availability or use
20981  PLIB_PORTS_ExistsPinChangeNotice in your application to determine whether
20982  this feature is available.
20983 */
20984 
20985 void
20987  PORTS_MODULE_ID index ,
20988  PORTS_CHANGE_NOTICE_PIN pinNum ) ;
20989 // *****************************************************************************
20990 /* Function:
20991  void PLIB_PORTS_ChangeNoticeInIdleEnable( PORTS_MODULE_ID index )
20992  Summary:
20993  CPU Idle mode does not affect Change Notice operation.
20994  Description:
20995  This function makes sure that Change Notice feature continues working in
20996  Idle mode.
20997  This function performs atomic register access.
20998 
20999  Precondition:
21000  None.
21001  Parameters:
21002  index - Identifier for the device instance to be configured
21003  Returns:
21004  None.
21005  Example:
21006  <code>
21007 
21008  // Change notification feature will be working even when CPU goes to
21009  // Idle mode
21010  PLIB_PORTS_ChangeNoticeInIdleEnable(PORTS_ID_0);
21011 
21012  </code>
21013  Remarks:
21014  This function is only available in devices without PPS. For PPS devices, use the
21015  PLIB_PORTS_ChangeNoticeInIdlePerPortEnable function.
21016 
21017  This feature may not be available on all devices. Please refer to the
21018  specific device data sheet to determine availability or use
21019  PLIB_PORTS_ExistsChangeNoticeInIdle in your application to determine whether
21020  this feature is available.
21021 */
21022 
21023 void
21025  PORTS_MODULE_ID index ) ;
21026 // *****************************************************************************
21027 /* Function:
21028  void PLIB_PORTS_ChangeNoticeInIdleDisable( PORTS_MODULE_ID index )
21029  Summary:
21030  CPU Idle halts the Change Notice operation.
21031  Description:
21032  This function halts the Change Notice operation when the CPU enters
21033  Idle mode.
21034  This function performs atomic register access.
21035  Precondition:
21036  None.
21037  Parameters:
21038  index - Identifier for the device instance to be configured
21039  Returns:
21040  None.
21041  Example:
21042  <code>
21043  // Halts the Change notification operation when CPU enters Idle mode
21044  PLIB_PORTS_ChangeNoticeInIdleDisable(PORTS_ID_0);
21045 
21046  </code>
21047  Remarks:
21048  This function is only available in devices without PPS. For PPS devices, use the
21049  PLIB_PORTS_ChangeNoticeInIdlePerPortDisable function.
21050 
21051  This feature may not be available on all devices. Please refer to the
21052  specific device data sheet to determine availability or use
21053  PLIB_PORTS_ExistsChangeNoticeInIdle in your application to determine whether
21054  this feature is available.
21055 */
21056 
21057 void
21059  PORTS_MODULE_ID index ) ;
21060 // *****************************************************************************
21061 /* Function:
21062  void PLIB_PORTS_ChangeNoticePullUpEnable( PORTS_MODULE_ID index,
21063  PORTS_CHANGE_NOTICE_PIN pinNum )
21064  Summary:
21065  Enable pull-up on input change.
21066  Description:
21067  This function enables pull-up on selected input change notification pin.
21068  This function performs atomic register access.
21069  Precondition:
21070  None.
21071  Parameters:
21072  index - Identifier for the device instance to be configured
21073  pinNum - Possible values of PORTS_CHANGE_NOTICE_PIN
21074  Returns:
21075  None.
21076  Example:
21077  <code>
21078 
21079  // Enable pull-up on pin CN13
21080  PLIB_PORTS_ChangeNoticePullUpEnable(PORTS_ID_0, CN13);
21081 
21082  </code>
21083  Remarks:
21084  This function is only available in devices without PPS. For PPS devices, use the
21085  PLIB_PORTS_ChangeNoticePullUpPerPortEnable function.
21086 
21087  This feature may not be available on all devices. Please refer to the
21088  specific device data sheet to determine availability or use
21089  PLIB_PORTS_ExistsChangeNoticePullUp in your application to determine whether
21090  this feature is available.
21091 */
21092 
21093 void
21095  PORTS_MODULE_ID index ,
21096  PORTS_CHANGE_NOTICE_PIN pinNum ) ;
21097 // *****************************************************************************
21098 /* Function:
21099  void PLIB_PORTS_ChangeNoticePullUpDisable( PORTS_MODULE_ID index,
21100  PORTS_CHANGE_NOTICE_PIN pinNum )
21101  Summary:
21102  Disable pull-up on input change.
21103  Description:
21104  This function disables pull-up on selected input change notification pin.
21105  This function performs atomic register access.
21106  Precondition:
21107  None.
21108  Parameters:
21109  index - Identifier for the device instance to be configured
21110  pinNum - Possible values of PORTS_CHANGE_NOTICE_PIN
21111  Returns:
21112  None.
21113  Example:
21114  <code>
21115 
21116  // Disable pull-up on pin CN13
21117  PLIB_PORTS_ChangeNoticePullUpDisable(PORTS_ID_0, CN13);
21118 
21119  </code>
21120  Remarks:
21121  This function is only available in devices without PPS. For PPS devices, use the
21122  PLIB_PORTS_ChangeNoticePullUpPerPortDisable function.
21123 
21124  This feature may not be available on all devices. Please refer to the
21125  specific device data sheet to determine availability or use
21126  PLIB_PORTS_ExistsChangeNoticePullUp in your application to determine whether
21127  this feature is available.
21128 */
21129 
21130 void
21132  PORTS_MODULE_ID index ,
21133  PORTS_CHANGE_NOTICE_PIN pinNum ) ;
21134 // *****************************************************************************
21135 /* Function:
21136  void PLIB_PORTS_ChannelSlewRateSelect
21137  (
21138  PORTS_MODULE_ID index,
21139  PORTS_CHANNEL channel,
21140  PORTS_DATA_MASK channelMask,
21141  PORTS_PIN_SLEW_RATE slewRate
21142  );
21143  Summary:
21144  Selects the slew rate for selected channel pins.
21145  Description:
21146  This function selects the slew rate for selected channel pins.
21147  This function does not perform atomic register access.
21148  Precondition:
21149  None.
21150  Parameters:
21151  index - Identifier for the device instance to be configured
21152  channel - Port pin channel
21153  channelMask - Identifies the pins for which slew rate has to be modified.
21154  Slew rate of the pins which corresponding bit is "1" get
21155  modified, slew rate of the other pins remains the same.
21156  slewRate - One of the possible values of PORTS_PIN_SLEW_RATE.
21157  Returns:
21158  None.
21159  Example:
21160  <code>
21161 
21162  // Make slew rate of pins RC5, RC8 and RC13 slowest
21163  PLIB_PORTS_ChannelSlewRateSelect(PORTS_ID_0,
21164  PORT_CHANNEL_C,
21165  0x2120,
21166  PORTS_PIN_SLEW_RATE_SLOWEST);
21167 
21168  </code>
21169  Remarks:
21170  This feature may not be available on all devices. Please refer to the
21171  specific device data sheet to determine availability or use
21172  PLIB_PORTS_ExistsSlewRateControl in your application to determine
21173  whether this feature is available.
21174 */
21175 
21176 void
21178  PORTS_MODULE_ID index ,
21179  PORTS_CHANNEL channel ,
21180  PORTS_DATA_MASK channelMask ,
21181  PORTS_PIN_SLEW_RATE slewRate ) ;
21182 // *****************************************************************************
21183 /* Function:
21184 PORTS_PIN_SLEW_RATE PLIB_PORTS_PinSlewRateGet
21185  (
21186  PORTS_MODULE_ID index,
21187  PORTS_CHANNEL channel,
21188  PORTS_BIT_POS bitPos
21189  );
21190  Summary:
21191  Gets the slew rate for selected port pin.
21192  Description:
21193  This function gets the slew rate of selected port pin.
21194  This function does not perform atomic register access.
21195  Precondition:
21196  None.
21197  Parameters:
21198  index - Identifier for the device instance to be configured
21199  channel - Port pin channel
21200  bitPos - One of the possible values of PORTS_BIT_POS.
21201  Returns:
21202  One of the possible values of PORTS_PIN_SLEW_RATE.
21203  Example:
21204  <code>
21205  PORTS_PIN_SLEW_RATE slewRate;
21206 
21207  // Get the slew rate of pin RC1
21208  slewRate = PLIB_PORTS_PinSlewRateGet(PORTS_ID_0, PORT_CHANNEL_C, PORTS_BIT_POS_1);
21209 
21210  </code>
21211  Remarks:
21212  This feature may not be available on all devices. Please refer to the
21213  specific device data sheet to determine availability or use
21214  PLIB_PORTS_ExistsSlewRateControl in your application to determine
21215  whether this feature is available.
21216 */
21217 
21218 PORTS_PIN_SLEW_RATE
21220  PORTS_MODULE_ID index ,
21221  PORTS_CHANNEL channel ,
21222  PORTS_BIT_POS bitPos ) ;
21223 // *****************************************************************************
21224 /* Function:
21225  void PLIB_PORTS_ChannelChangeNoticeMethodSelect
21226  (
21227  PORTS_MODULE_ID index,
21228  PORTS_CHANNEL channel,
21229  PORTS_CHANGE_NOTICE_METHOD changeNoticeMethod
21230  );
21231  Summary:
21232  Selects the Change Notice style for selected port channel.
21233  Description:
21234  This function selects the Change Notice style (or method) for selected port
21235  channel. It allows user to select whether the Change Notice detection will
21236  happen based on edge transition or level transition on all the CN pins of a
21237  particular channel.
21238  This function does not perform atomic register access.
21239  Precondition:
21240  None.
21241  Parameters:
21242  index - Identifier for the device instance to be configured
21243  channel - Port pin channel
21244  changeNoticeMethod - One of the possible values of PORTS_CHANGE_NOTICE_METHOD.
21245  Returns:
21246  None.
21247  Example:
21248  <code>
21249  PLIB_PORTS_ChannelChangeNoticeMethodSelect(PORTS_ID_0, PORT_CHANNEL_C,
21250  PORTS_CHANGE_NOTICE_METHOD_EDGE_DETECT);
21251  </code>
21252  Remarks:
21253  This feature may not be available on all devices. Please refer to the
21254  specific device data sheet to determine availability or use
21255  PLIB_PORTS_ExistsChannelChangeNoticeMethod in your application to determine
21256  whether this feature is available.
21257 */
21258 
21259 void
21261  PORTS_MODULE_ID index ,
21262  PORTS_CHANNEL channel ,
21263  PORTS_CHANGE_NOTICE_METHOD changeNoticeMethod ) ;
21264 // *****************************************************************************
21265 /* Function:
21266  PORTS_CHANGE_NOTICE_METHOD PLIB_PORTS_ChannelChangeNoticeMethodGet
21267  (
21268  PORTS_MODULE_ID index,
21269  PORTS_CHANNEL channel
21270  );
21271  Summary:
21272  Gets the Change Notice style for the selected port channel.
21273  Description:
21274  This function gets the Change Notice style (or method) for the selected port
21275  channel.
21276  This function does not perform atomic register access.
21277  Precondition:
21278  None.
21279  Parameters:
21280  index - Identifier for the device instance to be configured
21281  channel - Port pin channel
21282  Returns:
21283  One of the possible values of PORTS_CHANGE_NOTICE_METHOD.
21284  Example:
21285  <code>
21286  PORTS_CHANGE_NOTICE_METHOD changeNoticeMethod;
21287  changeNoticeMethod = PLIB_PORTS_ChannelChangeNoticeMethodGet(PORTS_ID_0, PORT_CHANNEL_C);
21288  </code>
21289  Remarks:
21290  This feature may not be available on all devices. Please refer to the
21291  specific device data sheet to determine availability or use
21292  PLIB_PORTS_ExistsChannelChangeNoticeMethod in your application to determine
21293  whether this feature is available.
21294 */
21295 
21296 PORTS_CHANGE_NOTICE_METHOD
21298  PORTS_MODULE_ID index ,
21299  PORTS_CHANNEL channel ) ;
21300 // *****************************************************************************
21301 /* Function:
21302  void PLIB_PORTS_ChannelChangeNoticeEdgeEnable
21303  (
21304  PORTS_MODULE_ID index,
21305  PORTS_CHANNEL channel,
21306  PORTS_DATA_MASK edgeRisingMask,
21307  PORTS_DATA_MASK edgeFallingMask
21308  );
21309  Summary:
21310  Enables selected type of edge for selected CN pins.
21311  Description:
21312  This function Enables selected type of edge (falling or rising) for
21313  selected CN pins of a port channel.
21314  This function does not perform atomic register access.
21315  Precondition:
21316  Change Notice method should be selected as
21317  "PORTS_CHANGE_NOTICE_METHOD_EDGE_DETECT" using
21318  PLIB_PORTS_ChannelChangeNoticeMethodSelect before using this function.
21319  Parameters:
21320  index - Identifier for the device instance to be configured
21321  channel - Port pin channel
21322  edgeRisingMask - Identifies the pins for which Change Notice has to be
21323  enabled for rising edge. Change Notice interrupt at rising
21324  edge is enabled for the pins which corresponding bit is
21325  '1', for the other pins it remains the same.
21326  edgeFallingMask - Identifies the pins for which Change Notice has to be
21327  enabled for falling edge. Change Notice interrupt at
21328  falling edge is enabled for the pins which corresponding
21329  bit is '1', for the other pins it remains the same.
21330  Returns:
21331  None.
21332  Example:
21333  <code>
21334  // Enable Change Notice at rising edge for RC1 pin and at falling edge for
21335  // RC1 & RC5 pins.
21336  PLIB_PORTS_ChannelChangeNoticeEdgeEnable(PORTS_ID_0, PORT_CHANNEL_C, 0x0002, 0x0022);
21337  </code>
21338  Remarks:
21339  This feature is not available on all devices. Please refer to the
21340  specific device data sheet to determine availability or use
21341  PLIB_PORTS_ExistsChangeNoticeEdgeControl in your application to determine
21342  whether this feature is available.
21343 */
21344 
21345 void
21347  PORTS_MODULE_ID index ,
21348  PORTS_CHANNEL channel ,
21349  PORTS_DATA_MASK edgeRisingMask ,
21350  PORTS_DATA_MASK edgeFallingMask ) ;
21351 // *****************************************************************************
21352 /* Function:
21353  void PLIB_PORTS_ChannelChangeNoticeEdgeDisable
21354  (
21355  PORTS_MODULE_ID index,
21356  PORTS_CHANNEL channel,
21357  PORTS_DATA_MASK edgeRisingMask,
21358  PORTS_DATA_MASK edgeFallingMask
21359  );
21360  Summary:
21361  Disables selected type of edge for selected CN pins.
21362  Description:
21363  This function Disables selected type of edge (falling or rising) for
21364  selected CN pins of a port channel.
21365  This function does not perform atomic register access.
21366  Precondition:
21367  Change Notice method should be selected as
21368  "PORTS_CHANGE_NOTICE_METHOD_EDGE_DETECT" using
21369  PLIB_PORTS_ChannelChangeNoticeMethodSelect before using this function.
21370  Parameters:
21371  index - Identifier for the device instance to be configured
21372  channel - Port pin channel
21373  edgeRisingMask - Identifies the pins for which Change Notice has to be
21374  enabled for rising edge. Change notice interrupt at rising
21375  edge is enabled for the pins which corresponding bit is
21376  '1', for the other pins it remains the same.
21377  edgeFallingMask - Identifies the pins for which Change Notice has to be
21378  enabled for falling edge. Change notice interrupt at
21379  falling edge is enabled for the pins which corresponding
21380  bit is '1', for the other pins it remains the same.
21381  Returns:
21382  None.
21383  Example:
21384  <code>
21385  // Disable Change Notice at rising edge for RC1 pin and at falling edge for
21386  // RC1 & RC5 pins.
21387  PLIB_PORTS_ChannelChangeNoticeEdgeDisable(PORTS_ID_0, PORT_CHANNEL_C, 0x0002, 0x0022);
21388  </code>
21389  Remarks:
21390  This feature is not available on all devices. Please refer to the
21391  specific device data sheet to determine availability or use
21392  PLIB_PORTS_ExistsChangeNoticeEdgeControl in your application to determine
21393  whether this feature is available.
21394 */
21395 
21396 void
21398  PORTS_MODULE_ID index ,
21399  PORTS_CHANNEL channel ,
21400  PORTS_DATA_MASK edgeRisingMask ,
21401  PORTS_DATA_MASK edgeFallingMask ) ;
21402 // *****************************************************************************
21403 /* Function:
21404  bool PLIB_PORTS_PinChangeNoticeEdgeIsEnabled
21405  (
21406  PORTS_MODULE_ID index,
21407  PORTS_CHANNEL channel,
21408  PORTS_BIT_POS bitPos,
21409  PORTS_CHANGE_NOTICE_EDGE cnEdgeType
21410  );
21411  Summary:
21412  Check if Change Notice edge is enabled or not.
21413  This function does not perform atomic register access.
21414  Description:
21415  This function checks if selected type of Change Notice edge is enabled on a
21416  particular port pin or not.
21417  This function does not perform atomic register access.
21418  Precondition:
21419  None.
21420  Parameters:
21421  index - Identifier for the device instance to be configured
21422  channel - Port pin channel
21423  bitPos - One of the possible values of PORTS_BIT_POS.
21424  cnEdgeType - Type of the edge which has to be checked.
21425 
21426  Returns:
21427  - true - Selected type of Change Notice Edge is enabled.
21428  - false - Selected type of Change Notice Edge is not enabled.
21429 
21430  Example:
21431  <code>
21432  // Check if Change Notice at rising edge is enabled or not for pin RC1.
21433  if (PLIB_PORTS_PinChangeNoticeEdgeIsEnabled(PORTS_ID_0, PORT_CHANNEL_C, PORTS_BIT_POS_1, PORTS_CHANGE_NOTICE_EDGE_RISING))
21434  {
21435  // do something
21436  }
21437  </code>
21438  Remarks:
21439  This feature is not available on all devices. Please refer to the
21440  specific device data sheet to determine availability or use
21441  PLIB_PORTS_ExistsChangeNoticeEdgeControl in your application to determine
21442  whether this feature is available.
21443 */
21444 
21445 bool
21447  PORTS_MODULE_ID index ,
21448  PORTS_CHANNEL channel ,
21449  PORTS_BIT_POS bitPos ,
21450  PORTS_CHANGE_NOTICE_EDGE cnEdgeType ) ;
21451 // *****************************************************************************
21452 /* Function:
21453  bool PLIB_PORTS_PinChangeNoticeEdgeHasOccurred
21454  (
21455  PORTS_MODULE_ID index,
21456  PORTS_CHANNEL channel,
21457  PORTS_BIT_POS bitPos
21458  );
21459  Summary:
21460  Check Change Notice edge status.
21461  Description:
21462  This function checks whether or no a Change Notice edge transition has occurred
21463  on the selected port pin.
21464  This function does not perform atomic register access.
21465  Precondition:
21466  None.
21467  Parameters:
21468  index - Identifier for the device instance to be configured
21469  channel - Port pin channel
21470  bitPos - One of the possible values of PORTS_BIT_POS
21471 
21472  Returns:
21473  - true - Change Notice edge transition has occurred
21474  - false - Change Notice edge transition has not occurred
21475 
21476  Example:
21477  <code>
21478  // Check if Change Notice edge transition has occurred for pin RC1.
21479  if (PLIB_PORTS_PinChangeNoticeEdgeHasOccurred(PORTS_ID_0, PORT_CHANNEL_C, PORTS_BIT_POS_1))
21480  {
21481  // do something
21482  }
21483  </code>
21484  Remarks:
21485  This feature is not available on all devices. Please refer to the
21486  specific device data sheet to determine availability or use
21487  PLIB_PORTS_ExistsChangeNoticeEdgeStatus in your application to determine
21488  whether this feature is available.
21489 */
21490 
21491 bool
21493  PORTS_MODULE_ID index ,
21494  PORTS_CHANNEL channel ,
21495  PORTS_BIT_POS bitPos ) ;
21496 // *****************************************************************************
21497 // *****************************************************************************
21498 // Section: Ports Peripheral Library Exists Functions
21499 // *****************************************************************************
21500 // *****************************************************************************
21501 /* The functions below indicate the existence of the features on the device.
21502 */
21503 //******************************************************************************
21504 /* Function:
21505  PLIB_PORTS_ExistsRemapInput( PORTS_MODULE_ID index )
21506  Summary:
21507  Identifies whether the RemapInput feature exists on the Ports module.
21508  Description:
21509  This function identifies whether the RemapInput feature is available on the
21510  Ports module.
21511  When this function returns true, this function is supported on the device:
21512  - PLIB_PORTS_RemapInput
21513  Preconditions:
21514  None.
21515  Parameters:
21516  index - Identifier for the device instance
21517  Returns:
21518  - true - The RemapInput feature is supported on the device
21519  - false - The RemapInput feature is not supported on the device
21520  Remarks:
21521  None.
21522 */
21523 
21524 bool
21526  PORTS_MODULE_ID index ) ;
21527 //******************************************************************************
21528 /* Function:
21529  PLIB_PORTS_ExistsRemapOutput( PORTS_MODULE_ID index )
21530  Summary:
21531  Identifies whether the RemapOutput feature exists on the Ports module.
21532  Description:
21533  This function identifies whether the RemapOutput feature is available on the
21534  Ports module.
21535  When this function returns true, this function is supported on the device:
21536  - PLIB_PORTS_RemapOutput
21537  Preconditions:
21538  None.
21539  Parameters:
21540  index - Identifier for the device instance
21541  Returns:
21542  - true - The RemapOutput feature is supported on the device
21543  - false - The RemapOutput feature is not supported on the device
21544  Remarks:
21545  None.
21546 */
21547 
21548 bool
21550  PORTS_MODULE_ID index ) ;
21551 //******************************************************************************
21552 /* Function:
21553  PLIB_PORTS_ExistsPinMode( PORTS_MODULE_ID index )
21554  Summary:
21555  Identifies whether the PinMode feature exists on the Ports module.
21556  Description:
21557  This function identifies whether the PinMode (Analog Pin or Digital Pin)
21558  feature is available on the Ports module.
21559  When this function returns true, this function is supported on the device:
21560  - PLIB_PORTS_PinModeSelect
21561  Preconditions:
21562  None.
21563  Parameters:
21564  index - Identifier for the device instance
21565  Returns:
21566  - true - The PinMode feature is supported on the device
21567  - false - The PinMode feature is not supported on the device
21568  Remarks:
21569  None.
21570 */
21571 
21572 bool
21574  PORTS_MODULE_ID index ) ;
21575 //******************************************************************************
21576 /* Function:
21577  PLIB_PORTS_ExistsAnPinsMode( PORTS_MODULE_ID index )
21578  Summary:
21579  Identifies whether the AnPinsMode feature exists on the Ports module.
21580  Description:
21581  This function identifies whether the AnPinsMode feature is available on the
21582  Ports module.
21583  When this function returns true, this function is supported on the device:
21584  - PLIB_PORTS_AnPinsModeSelect
21585  Preconditions:
21586  None.
21587  Parameters:
21588  index - Identifier for the device instance
21589  Returns:
21590  - true - The AnPinsMode feature is supported on the device
21591  - false - The AnPinsMode feature is not supported on the device
21592  Remarks:
21593  None.
21594 */
21595 
21596 bool
21598  PORTS_MODULE_ID index ) ;
21599 //******************************************************************************
21600 /* Function:
21601  PLIB_PORTS_ExistsPortsRead( PORTS_MODULE_ID index )
21602  Summary:
21603  Identifies whether the PortsRead feature exists on the Ports module.
21604  Description:
21605  This function identifies whether the PortsRead feature is available on the
21606  Ports module.
21607  When this function returns true, these functions are supported on the device:
21608  - PLIB_PORTS_PinGet
21609  - PLIB_PORTS_Read
21610  Preconditions:
21611  None.
21612  Parameters:
21613  index - Identifier for the device instance
21614  Returns:
21615  - true - The PortsRead feature is supported on the device
21616  - false - The PortsRead feature is not supported on the device
21617  Remarks:
21618  None.
21619 */
21620 
21621 bool
21623  PORTS_MODULE_ID index ) ;
21624 //******************************************************************************
21625 /* Function:
21626  PLIB_PORTS_ExistsLatchRead( PORTS_MODULE_ID index )
21627  Summary:
21628  Identifies whether the LatchRead feature exists on the Ports module.
21629  Description:
21630  This function identifies whether the LatchRead feature is available on the
21631  Ports module.
21632  When this function returns true, these functions are supported on the device:
21633  - PLIB_PORTS_PinGetLatched
21634  - PLIB_PORTS_ReadLatched
21635  Preconditions:
21636  None.
21637  Parameters:
21638  index - Identifier for the device instance
21639  Returns:
21640  - true - The LatchRead feature is supported on the device
21641  - false - The LatchRead feature is not supported on the device
21642  Remarks:
21643  None.
21644 */
21645 
21646 bool
21648  PORTS_MODULE_ID index ) ;
21649 //******************************************************************************
21650 /* Function:
21651  PLIB_PORTS_ExistsPortsWrite( PORTS_MODULE_ID index )
21652  Summary:
21653  Identifies whether the PortsWrite feature exists on the Ports module.
21654  Description:
21655  This function identifies whether the PortsWrite feature is available on the
21656  Ports module.
21657  When this function returns true, these functions are supported on the device:
21658  - PLIB_PORTS_PinWrite
21659  - PLIB_PORTS_PinSet
21660  - PLIB_PORTS_PinClear
21661  - PLIB_PORTS_PinToggle
21662  - PLIB_PORTS_Write
21663  - PLIB_PORTS_Set
21664  - PLIB_PORTS_Toggle
21665  - PLIB_PORTS_Clear
21666  Preconditions:
21667  None.
21668  Parameters:
21669  index - Identifier for the device instance
21670  Returns:
21671  - true - The PortsWrite feature is supported on the device
21672  - false - The PortsWrite feature is not supported on the device
21673  Remarks:
21674  None.
21675 */
21676 
21677 bool
21679  PORTS_MODULE_ID index ) ;
21680 //******************************************************************************
21681 /* Function:
21682  PLIB_PORTS_ExistsPortsDirection( PORTS_MODULE_ID index )
21683  Summary:
21684  Identifies whether the PortsDirection feature exists on the Ports module.
21685  Description:
21686  This function identifies whether the PortsDirection feature is available on the
21687  Ports module.
21688  When this function returns true, these functions are supported on the device:
21689  - PLIB_PORTS_PinDirectionInputSet
21690  - PLIB_PORTS_PinDirectionOutputSet
21691  - PLIB_PORTS_DirectionInputSet
21692  - PLIB_PORTS_DirectionOutputSet
21693  - PLIB_PORTS_DirectionGet
21694  Preconditions:
21695  None.
21696  Parameters:
21697  index - Identifier for the device instance
21698  Returns:
21699  - true - The PortsDirection feature is supported on the device
21700  - false - The PortsDirection feature is not supported on the device
21701  Remarks:
21702  None.
21703 */
21704 
21705 bool
21707  PORTS_MODULE_ID index ) ;
21708 //******************************************************************************
21709 /* Function:
21710  PLIB_PORTS_ExistsPortsOpenDrain( PORTS_MODULE_ID index )
21711  Summary:
21712  Identifies whether the PortsOpenDrain feature exists on the Ports module.
21713  Description:
21714  This function identifies whether the PortsOpenDrain feature is available on
21715  the Ports module.
21716  When this function returns true, these functions are supported on the device:
21717  - PLIB_PORTS_PinOpenDrainEnable
21718  - PLIB_PORTS_PinOpenDrainDisable
21719  - PLIB_PORTS_OpenDrainEnable
21720  - PLIB_PORTS_OpenDrainDisable
21721  Preconditions:
21722  None.
21723  Parameters:
21724  index - Identifier for the device instance
21725  Returns:
21726  - true - The PortsOpenDrain feature is supported on the device
21727  - false - The PortsOpenDrain feature is not supported on the device
21728  Remarks:
21729  None.
21730 */
21731 
21732 bool
21734  PORTS_MODULE_ID index ) ;
21735 //******************************************************************************
21736 /* Function:
21737  PLIB_PORTS_ExistsChangeNotice( PORTS_MODULE_ID index )
21738  Summary:
21739  Identifies whether the ChangeNotice feature exists on the Ports module.
21740  Description:
21741  This function identifies whether the ChangeNotice feature is available on the
21742  Ports module.
21743  When this function returns true, these functions are supported on the device:
21744  - PLIB_PORTS_ChangeNoticeEnable
21745  - PLIB_PORTS_ChangeNoticeDisable
21746  Preconditions:
21747  None.
21748  Parameters:
21749  index - Identifier for the device instance
21750  Returns:
21751  - true - The ChangeNotice feature is supported on the device
21752  - false - The ChangeNotice feature is not supported on the device
21753  Remarks:
21754  None.
21755 */
21756 
21757 bool
21759  PORTS_MODULE_ID index ) ;
21760 //******************************************************************************
21761 /* Function:
21762  PLIB_PORTS_ExistsPinChangeNotice( PORTS_MODULE_ID index )
21763  Summary:
21764  Identifies whether the PinChangeNotice feature exists on the Ports module.
21765  Description:
21766  This function identifies whether the PinChangeNotice feature is available on
21767  the Ports module.
21768  When this function returns true, these functions are supported on the device:
21769  - PLIB_PORTS_PinChangeNoticeEnable
21770  - PLIB_PORTS_PinChangeNoticeDisable
21771  - PLIB_PORTS_CnPinsEnable
21772  - PLIB_PORTS_CnPinsDisable
21773  Preconditions:
21774  None.
21775  Parameters:
21776  index - Identifier for the device instance
21777  Returns:
21778  - true - The PinChangeNotice feature is supported on the device
21779  - false - The PinChangeNotice feature is not supported on the device
21780  Remarks:
21781  None.
21782 */
21783 
21784 bool
21786  PORTS_MODULE_ID index ) ;
21787 //******************************************************************************
21788 /* Function:
21789  PLIB_PORTS_ExistsChangeNoticeInIdle( PORTS_MODULE_ID index )
21790  Summary:
21791  Identifies whether the ChangeNoticeInIdle feature exists on the Ports module.
21792  Description:
21793  This function identifies whether the ChangeNoticeInIdle feature is available
21794  on the Ports module.
21795  When this function returns true, these functions are supported on the device:
21796  - PLIB_PORTS_ChangeNoticeInIdleEnable
21797  - PLIB_PORTS_ChangeNoticeInIdleDisable
21798  Preconditions:
21799  None.
21800  Parameters:
21801  index - Identifier for the device instance
21802  Returns:
21803  - true - The ChangeNoticeInIdle feature is supported on the device
21804  - false - The ChangeNoticeInIdle feature is not supported on the device
21805  Remarks:
21806  None.
21807 */
21808 
21809 bool
21811  PORTS_MODULE_ID index ) ;
21812 //******************************************************************************
21813 /* Function:
21814  PLIB_PORTS_ExistsChangeNoticePullUp( PORTS_MODULE_ID index )
21815  Summary:
21816  Identifies whether the ChangeNoticePullup feature exists on the Ports module.
21817  Description:
21818  This function identifies whether the ChangeNoticePullup feature is available
21819  on the Ports module.
21820  When this function returns true, these functions are supported on the device:
21821  - PLIB_PORTS_ChangeNoticePullUpEnable
21822  - PLIB_PORTS_ChangeNoticePullUpDisable
21823  - PLIB_PORTS_CnPinsPullUpEnable
21824  - PLIB_PORTS_CnPinsPullUpDisable
21825  Preconditions:
21826  None.
21827  Parameters:
21828  index - Identifier for the device instance
21829  Returns:
21830  - true - The ChangeNoticePullup feature is supported on the device
21831  - false - The ChangeNoticePullup feature is not supported on the device
21832  Remarks:
21833  None.
21834 */
21835 
21836 bool
21838  PORTS_MODULE_ID index ) ;
21839 //******************************************************************************
21840 /* Function:
21841  PLIB_PORTS_ExistsPinModePerPort( PORTS_MODULE_ID index )
21842  Summary:
21843  Identifies whether the PinModePerPort feature exists on the Ports module.
21844  Description:
21845  This function identifies whether the PinModePerPort (Analog Pin or Digital Pin)
21846  feature is available on the Ports module.
21847  When this function returns true, these functions are supported on the device:
21848  - PLIB_PORTS_PinModePerPortSelect
21849  - PLIB_PORTS_ChannelModeSelect
21850  Preconditions:
21851  None.
21852  Parameters:
21853  index - Identifier for the device instance
21854  Returns:
21855  - true - The PinModePerPort feature is supported on the device
21856  - false - The PinModePerPort feature is not supported on the device
21857  Remarks:
21858  None.
21859 */
21860 
21861 bool
21863  PORTS_MODULE_ID index ) ;
21864 //******************************************************************************
21865 /* Function:
21866  PLIB_PORTS_ExistsChangeNoticePullDownPerPort( PORTS_MODULE_ID index )
21867  Summary:
21868  Identifies whether the ChangeNoticePullDownPerPort feature exists on the
21869  Ports module.
21870  Description:
21871  This function identifies whether the ChangeNoticePullDownPerPort feature is
21872  available on the Ports module.
21873  When this function returns true, these functions are supported on the device:
21874  - PLIB_PORTS_ChangeNoticePullDownPerPortEnable
21875  - PLIB_PORTS_ChangeNoticePullDownPerPortDisable
21876  - PLIB_PORTS_ChannelChangeNoticePullDownEnable
21877  - PLIB_PORTS_ChannelChangeNoticePullDownDisable
21878  Preconditions:
21879  None.
21880  Parameters:
21881  index - Identifier for the device instance
21882  Returns:
21883  - true - The ChangeNoticePullDownPerPort feature is supported on the device
21884  - false - The ChangeNoticePullDownPerPort feature is not supported on the device
21885  Remarks:
21886  None.
21887 */
21888 
21889 bool
21891  PORTS_MODULE_ID index ) ;
21892 //******************************************************************************
21893 /* Function:
21894  PLIB_PORTS_ExistsChangeNoticePullUpPerPort( PORTS_MODULE_ID index )
21895  Summary:
21896  Identifies whether the ChangeNoticePullUpPerPort feature exists on the Ports
21897  module.
21898  Description:
21899  This function identifies whether the ChangeNoticePullUpPerPort feature is available
21900  on the Ports module.
21901  When this function returns true, these functions are supported on the device:
21902  - PLIB_PORTS_ChangeNoticePullUpPerPortEnable
21903  - PLIB_PORTS_ChangeNoticePullUpPerPortDisable
21904  - PLIB_PORTS_ChannelChangeNoticePullUpEnable
21905  - PLIB_PORTS_ChannelChangeNoticePullUpDisable
21906  Preconditions:
21907  None.
21908  Parameters:
21909  index - Identifier for the device instance
21910  Returns:
21911  - true - The ChangeNoticePullUpPerPort feature is supported on the device
21912  - false - The ChangeNoticePullUpPerPort feature is not supported on the device
21913  Remarks:
21914  None.
21915 */
21916 
21917 bool
21919  PORTS_MODULE_ID index ) ;
21920 //******************************************************************************
21921 /* Function:
21922  PLIB_PORTS_ExistsPinChangeNoticePerPort( PORTS_MODULE_ID index )
21923  Summary:
21924  Identifies whether the PinChangeNoticePerPort feature exists on the Ports
21925  module.
21926  Description:
21927  This function identifies whether the PinChangeNoticePerPort feature is
21928  available on the Ports module.
21929  When this function returns true, these functions are supported on the device:
21930  - PLIB_PORTS_PinChangeNoticePerPortEnable
21931  - PLIB_PORTS_PinChangeNoticePerPortDisable
21932  - PLIB_PORTS_ChannelChangeNoticeEnable
21933  - PLIB_PORTS_ChannelChangeNoticeDisable
21934  Preconditions:
21935  None.
21936  Parameters:
21937  index - Identifier for the device instance
21938  Returns:
21939  - true - The PinChangeNoticePerPort feature is supported on the device
21940  - false - The PinChangeNoticePerPort feature is not supported on the device
21941  Remarks:
21942  None.
21943 */
21944 
21945 bool
21947  PORTS_MODULE_ID index ) ;
21948 //******************************************************************************
21949 /* Function:
21950  PLIB_PORTS_ExistsChangeNoticePerPortTurnOn( PORTS_MODULE_ID index )
21951  Summary:
21952  Identifies whether the ChangeNoticePerPortTurnOn feature exists on the Ports
21953  module.
21954  Description:
21955  This function identifies whether the ChangeNoticePerPortTurnOn feature is
21956  available on the Ports module.
21957  When this function returns true, these functions are supported on the device:
21958  - PLIB_PORTS_ChangeNoticePerPortTurnOn
21959  - PLIB_PORTS_ChangeNoticePerPortTurnOff
21960  Preconditions:
21961  None.
21962  Parameters:
21963  index - Identifier for the device instance
21964  Returns:
21965  - true - The ChangeNoticePerPortTurnOn feature is supported on the device
21966  - false - The ChangeNoticePerPortTurnOn feature is not supported on the device
21967  Remarks:
21968  None.
21969 */
21970 
21971 bool
21973  PORTS_MODULE_ID index ) ;
21974 //******************************************************************************
21975 /* Function:
21976  PLIB_PORTS_ExistsChangeNoticePerPortInIdle( PORTS_MODULE_ID index )
21977  Summary:
21978  Identifies whether the ChangeNoticeInIdlePerPort feature exists on the Ports
21979  module.
21980  Description:
21981  This function identifies whether the ChangeNoticeInIdlePerPort feature is
21982  available on the Ports module.
21983  When this function returns true, these functions are supported on the device:
21984  - PLIB_PORTS_ChangeNoticeInIdlePerPortEnable
21985  - PLIB_PORTS_ChangeNoticeInIdlePerPortDisable
21986  Preconditions:
21987  None.
21988  Parameters:
21989  index - Identifier for the device instance
21990  Returns:
21991  - true - The ChangeNoticeInIdlePerPort feature is supported on the device
21992  - false - The ChangeNoticeInIdlePerPort feature is not supported on the device
21993  Remarks:
21994  None.
21995 */
21996 
21997 bool
21999  PORTS_MODULE_ID index ) ;
22000 //******************************************************************************
22001 /* Function:
22002  PLIB_PORTS_ExistsChangeNoticePerPortStatus( PORTS_MODULE_ID index )
22003  Summary:
22004  Identifies whether the ChangeNoticePerPortStatus feature exists on the Ports
22005  module.
22006  Description:
22007  This function identifies whether the ChangeNoticePerPortStatus feature is
22008  available on the Ports module.
22009  When this function returns true, these functions are supported on the device:
22010  - PLIB_PORTS_ChangeNoticePerPortHasOccured
22011  - PLIB_PORTS_ChangeNoticePerPortHasOccurred
22012  Preconditions:
22013  None.
22014  Parameters:
22015  index - Identifier for the device instance
22016  Returns:
22017  - true - The ChangeNoticePerPortStatus feature is supported on the device
22018  - false - The ChangeNoticePerPortStatus feature is not supported on the device
22019  Remarks:
22020  None.
22021 */
22022 
22023 bool
22025  PORTS_MODULE_ID index ) ;
22026 //******************************************************************************
22027 /* Function:
22028  PLIB_PORTS_ExistsSlewRateControl( PORTS_MODULE_ID index )
22029  Summary:
22030  Identifies whether the SlewRateControl feature exists on the Ports module.
22031  Description:
22032  This function identifies whether the SlewRateControl feature is available
22033  on the Ports module.
22034  When this function returns true, these functions are supported on the device:
22035  - PLIB_PORTS_ChannelSlewRateSelect
22036  - PLIB_PORTS_PinSlewRateGet
22037  Preconditions:
22038  None.
22039  Parameters:
22040  index - Identifier for the device instance
22041  Returns:
22042  - true - The SlewRateControl feature is supported on the device
22043  - false - The SlewRateControl feature is not supported on the device
22044  Remarks:
22045  None.
22046 */
22047 
22048 bool
22050  PORTS_MODULE_ID index ) ;
22051 //******************************************************************************
22052 /* Function:
22053  PLIB_PORTS_ExistsChannelChangeNoticeMethod( PORTS_MODULE_ID index )
22054  Summary:
22055  Identifies whether the ChannelChangeNoticeMethod feature exists on the
22056  Ports module.
22057  Description:
22058  This function identifies whether the ChannelChangeNoticeMethod feature is
22059  available on the Ports module.
22060  When this function returns true, these functions are supported on the device:
22061  - PLIB_PORTS_ChannelChangeNoticeMethodSelect
22062  - PLIB_PORTS_ChannelChangeNoticeMethodGet
22063  Preconditions:
22064  None.
22065  Parameters:
22066  index - Identifier for the device instance
22067  Returns:
22068  - true - The ChannelChangeNoticeMethod feature is supported on the device
22069  - false - The ChannelChangeNoticeMethod feature is not supported on the device
22070  Remarks:
22071  None.
22072 */
22073 
22074 bool
22076  PORTS_MODULE_ID index ) ;
22077 //******************************************************************************
22078 /* Function:
22079  PLIB_PORTS_ExistsChangeNoticeEdgeControl( PORTS_MODULE_ID index )
22080  Summary:
22081  Identifies whether the ChangeNoticeEdgeControl feature exists on the Ports
22082  module.
22083  Description:
22084  This function identifies whether the ChangeNoticeEdgeControl feature is
22085  available on the Ports module.
22086  When this function returns true, these functions are supported on the device:
22087  - PLIB_PORTS_ChannelChangeNoticeEdgeEnable
22088  - PLIB_PORTS_ChannelChangeNoticeEdgeDisable
22089  - PLIB_PORTS_PinChangeNoticeEdgeIsEnabled
22090  Preconditions:
22091  None.
22092  Parameters:
22093  index - Identifier for the device instance
22094  Returns:
22095  - true - The ChangeNoticeEdgeControl feature is supported on the device
22096  - false - The ChangeNoticeEdgeControl feature is not supported on the device
22097  Remarks:
22098  None.
22099 */
22100 
22101 bool
22103  PORTS_MODULE_ID index ) ;
22104 //******************************************************************************
22105 /* Function:
22106  PLIB_PORTS_ExistsChangeNoticeEdgeStatus( PORTS_MODULE_ID index )
22107  Summary:
22108  Identifies whether the ChangeNoticeEdgeStatus feature exists on the Ports
22109  module.
22110  Description:
22111  This function identifies whether the ChangeNoticeEdgeStatus feature is available
22112  on the Ports module.
22113  When this function returns true, this function is supported on the device:
22114  - PLIB_PORTS_PinChangeNoticeEdgeHasOccurred
22115  Preconditions:
22116  None.
22117  Parameters:
22118  index - Identifier for the device instance
22119  Returns:
22120  - true - The ChangeNoticeEdgeStatus feature is supported on the device
22121  - false - The ChangeNoticeEdgeStatus feature is not supported on the device
22122  Remarks:
22123  None.
22124 */
22125 
22126 bool
22128  PORTS_MODULE_ID index ) ;
22129 /* OPEN FILE C:\microchip\harmony\v2_06\framework\peripheral\ports\plib_ports_compatibility.h */
22130 /*******************************************************************************
22131  Ports Peripheral Library Compatibility Header
22132  Company:
22133  Microchip Technology Inc.
22134  File Name:
22135  plib_ports_compatibility.h
22136  Summary:
22137  Ports Peripheral Library Interface header for backward compatibility.
22138  Description:
22139  This header file contains the definitions of the functions which are
22140  supported for backward compatibility only. These will be deprecated later.
22141 *******************************************************************************/
22142 // DOM-IGNORE-BEGIN
22143 /*******************************************************************************
22144 Copyright 2013-2015 released Microchip Technology Inc. All rights reserved.
22145 Microchip licenses to you the right to use, modify, copy and distribute
22146 Software only when embedded on a Microchip microcontroller or digital signal
22147 controller that is integrated into your product or third party product
22148 (pursuant to the sublicense terms in the accompanying license agreement).
22149 You should refer to the license agreement accompanying this Software for
22150 additional information regarding your rights and obligations.
22151 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
22152 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
22153 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
22154 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
22155 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
22156 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
22157 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
22158 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
22159 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
22160 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
22161 *******************************************************************************/
22162 // DOM-IGNORE-END
22163 #ifndef _PLIB_PORTS_COMPATIBILITY_H
22164 #define _PLIB_PORTS_COMPATIBILITY_H
22165 #include <stdint.h>
22166 #include <stddef.h>
22167 // *****************************************************************************
22168 /* Function:
22169  bool PLIB_PORTS_ChangeNoticePerPortHasOccured ( PORTS_MODULE_ID index,
22170  PORTS_CHANNEL channel, PORTS_BIT_POS bitPos );
22171  Summary:
22172  checks the status of change on the pin
22173  Description:
22174  This function checks if the change has occurred on the given pin or not.
22175  Precondition:
22176  None.
22177  Parameters:
22178  index - Identifier for the device instance to be configured
22179  channel - Port pin channel
22180  bitPos - Position in the PORT pins
22181  Returns:
22182  None.
22183  Example:
22184  <code>
22185 
22186  if(PLIB_PORTS_ChangeNoticePerPortHasOccured( PORTS_ID_0,
22187  PORT_CHANNEL_C, PORTS_BIT_POS_4 ) == True)
22188  {
22189  //do something
22190  }
22191 
22192  </code>
22193  Remarks:
22194  This feature may not be available on all devices. Please refer to the
22195  specific device data sheet to determine availability or use
22196  PLIB_PORTS_ExistsChangeNoticePerPortStatus in your application to determine
22197  whether this feature is available.
22198 
22199  This function will be deprecated later.
22200 */
22201 #define PLIB_PORTS_ChangeNoticePerPortHasOccured PLIB_PORTS_ChangeNoticePerPortHasOccurred
22202  // #ifndef _PLIB_PORTS_COMPATIBILITY_H
22203 /*******************************************************************************
22204  End of File
22205 */
22206 #endif /*00 C:\microchip\harmony\v2_06\framework\peripheral\ports\plib_ports_compatibility.h*/
22207 /* CLOSE_FILE Include File */
22208 
22209 //DOM-IGNORE-BEGIN
22210 //DOM-IGNORE-END
22211  // #ifndef _PLIB_PORTS_H
22212 /*******************************************************************************
22213  End of File
22214 */
22215 #endif /*00 C:\microchip\harmony\v2_06\framework\peripheral\ports\plib_ports.h*/
22216 /* CLOSE_FILE Include File */
22217 
22218 #include "system/int/sys_int.h"
22219 // *****************************************************************************
22220 // *****************************************************************************
22221 // Section: SYS PORTS Data Types
22222 // *****************************************************************************
22223 // *****************************************************************************
22224 // *****************************************************************************
22225 /* SYS PORTS PULLUP status
22226  Summary:
22227  Provides the pull-up and pull-down status.
22228  Description:
22229  These constants provide the pull-up or pull-down status definitions.
22230  Remarks:
22231  None.
22232 */
22233 
22234 typedef
22235  enum
22236  {
22237  /* PULLUP Disable */
22239  /*DOM-IGNORE-BEGIN*/
22240  = 0 /*DOM-IGNORE-END*/
22241  ,
22242  /* PULLUP Enable */
22244  /*DOM-IGNORE-BEGIN*/
22245  = 1 /*DOM-IGNORE-END*/
22246  ,
22248 // *****************************************************************************
22249 /* SYS PORTS PIN DIRECTION
22250  Summary:
22251  Defines the direction of the port pins.
22252  Description:
22253  These constants provide the port pin direction definitions.
22254  Remarks:
22255  None.
22256 */
22257 
22258 typedef
22259  enum
22260  {
22261  /* Direction as output */
22263  /*DOM-IGNORE-BEGIN*/
22264  = 0 /*DOM-IGNORE-END*/
22265  ,
22266  /* Direction as input */
22268  /*DOM-IGNORE-BEGIN*/
22269  = 1 /*DOM-IGNORE-END*/
22270  ,
22272 
22273 typedef
22274  enum
22275  {
22278  // #ifndef _SYS_PORTS_DEFINITIONS_H
22279 /*******************************************************************************
22280  End of File
22281 */
22282 
22283 #endif /*00 C:\microchip\harmony\v2_06\framework\system\ports\sys_ports_definitions.h*/
22284 /* CLOSE_FILE Include File */
22285 
22286 // DOM-IGNORE-BEGIN
22287 // DOM-IGNORE-END
22288 // *****************************************************************************
22289 // *****************************************************************************
22290 // Section: SYS PorTS Module Initialization Routine
22291 // *****************************************************************************
22292 // *****************************************************************************
22293 // *****************************************************************************
22294 /* Function:
22295  void SYS_PORTS_Initialize()
22296  Summary:
22297  Initializes PORT Pins/Channels.
22298  <p><b>Implementation:</b> Static/Dynamic</p>
22299  Description:
22300  This function initializes different port pins/channels to the desired state.
22301  It also remaps the pins to the desired specific function.
22302  Precondition:
22303  None.
22304  Parameters:
22305  None.
22306  Returns:
22307  None.
22308  Example:
22309  <code>
22310  SYS_PORTS_Initialize();
22311  </code>
22312  Remarks:
22313  This API must be be called at the time of system initialization to
22314  initialize the ports pins.
22315 */
22316 
22317 void
22319 // *****************************************************************************
22320 // *****************************************************************************
22321 // Section: SYS PORTS CONTROL Routines
22322 // *****************************************************************************
22323 // *****************************************************************************
22324 // *****************************************************************************
22325 /* Function:
22326  PORTS_DATA_TYPE SYS_PORTS_Read( PORTS_MODULE_ID index, PORTS_CHANNEL channel )
22327  Summary:
22328  Reads the data from the I/O port.
22329  <p><b>Implementation:</b> Dynamic</p>
22330  Description:
22331  This function reads the data from the I/O port.
22332  Preconditions:
22333  The direction of the port to be set as input.
22334  Parameters:
22335  index - Identifier for the device instance to be configured
22336  channel - Identifier for the PORT channel: A, B, C, etc.
22337  Returns:
22338  Returns the data read from the port.
22339  Example:
22340  <code>
22341  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22342  // application developer.
22343  PORTS_DATA_TYPE readData;
22344  readData = SYS_PORTS_Read( MY_PORTS_INSTANCE, MY_CHANNEL );
22345  </code>
22346  Remarks:
22347  None.
22348 */
22349 
22351  SYS_PORTS_Read (
22352  PORTS_MODULE_ID index ,
22353  PORTS_CHANNEL channel ) ;
22354 // *****************************************************************************
22355 /* Function:
22356  void SYS_PORTS_Write( PORTS_MODULE_ID index,
22357  PORTS_CHANNEL channel,
22358  PORTS_DATA_TYPE value )
22359  Summary:
22360  Writes the data to the I/O port.
22361  <p><b>Implementation:</b> Dynamic</p>
22362  Description:
22363  This function writes the data to the I/O port.
22364  Preconditions:
22365  The direction of the port to be set as output.
22366  Parameters:
22367  index - Identifier for the device instance to be configured
22368  channel - Identifier for the PORT channel: A, B, C, etc.
22369  value - Value to be written into a port of width PORTS_DATA_TYPE
22370  Returns:
22371  None.
22372  Example:
22373  <code>
22374  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22375  // application developer.
22376  PORTS_DATA_TYPE writeData;
22377  SYS_PORTS_Write( MY_PORTS_INSTANCE, MY_CHANNEL, MY_VALUE );
22378  </code>
22379  Remarks:
22380  None.
22381 */
22382 
22383 void
22384  SYS_PORTS_Write (
22385  PORTS_MODULE_ID index ,
22386  PORTS_CHANNEL channel ,
22387  PORTS_DATA_TYPE value ) ;
22388 // *****************************************************************************
22389 /* Function:
22390  PORTS_DATA_TYPE SYS_PORTS_LatchedGet( PORTS_MODULE_ID index, PORTS_CHANNEL channel )
22391  Summary:
22392  Reads the data driven on the I/O port.
22393  <p><b>Implementation:</b> Dynamic</p>
22394  Description:
22395  This function reads the data driven on the I/O port.
22396  Preconditions:
22397  The direction of the port to be set as output.
22398  Parameters:
22399  index - Identifier for the device instance to be configured
22400  channel - Identifier for the PORT channel: A, B, C, etc.
22401  Returns:
22402  Returns the data driven on the port.
22403  Example:
22404  <code>
22405  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22406  // application developer.
22407  PORTS_DATA_TYPE drivenData;
22408  drivenData = SYS_PORTS_LatchedGet( MY_PORTS_INSTANCE, MY_CHANNEL );
22409  </code>
22410  Remarks:
22411  None.
22412 */
22413 
22416  PORTS_MODULE_ID index ,
22417  PORTS_CHANNEL channel ) ;
22418 // *****************************************************************************
22419 /* Function:
22420  void SYS_PORTS_Set( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
22421  PORTS_DATA_TYPE value,
22422  PORTS_DATA_MASK mask )
22423  Summary:
22424  Sets the selected digital port/latch based on the mask.
22425  <p><b>Implementation:</b> Dynamic</p>
22426  Description:
22427  This function Sets the selected digital port/latch relative to the mask.
22428  This function "AND" value and mask parameters and then set the bits
22429  in the port channel that were set in the result of the ANDing operation.
22430  Preconditions:
22431  None.
22432  Parameters:
22433  index - Identifier for the device instance to be configured
22434  channel - Identifier for the PORT channel: A, B, C, etc.
22435  value - Consists of information about which port bit has to be set
22436  mask - Identifies the bits which could be intended for setting
22437  Returns:
22438  None.
22439  Example:
22440  <code>
22441  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22442  // application developer.
22443  // MY_VALUE - 0x1234
22444  PORTS_DATA_MASK myMask = (PORTS_DATA_MASK)0x00FF;
22445  // Set the MY_CHANNEL bit positions 2,4 and 5 (0x0034 = b0000 0000 0011 0100)
22446  SYS_PORTS_Set(MY_PORTS_INSTANCE, MY_CHANNEL, MY_VALUE, myMask);
22447  </code>
22448  Remarks:
22449  Not all features are available on all devices. Refer to the specific device
22450  data sheet for availability.
22451 */
22452 
22453 void
22454  SYS_PORTS_Set (
22455  PORTS_MODULE_ID index ,
22456  PORTS_CHANNEL channel ,
22457  PORTS_DATA_TYPE value ,
22458  PORTS_DATA_MASK mask ) ;
22459 // *****************************************************************************
22460 /* Function:
22461  void SYS_PORTS_Clear ( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
22462  PORTS_DATA_MASK clearMask )
22463  Summary:
22464  Clears the selected digital port.
22465  <p><b>Implementation:</b> Dynamic</p>
22466  Description:
22467  This function clears the selected digital port.
22468  Preconditions:
22469  None.
22470  Parameters:
22471  index - Identifier for the device instance to be configured
22472  channel - Identifier for the PORT channel: A, B, C, etc.
22473  clearMask - Identifies the bits to be cleared
22474  Returns:
22475  None.
22476  Example:
22477  <code>
22478  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22479  // application developer.
22480  PORTS_DATA_MASK clearMask = (PORTS_DATA_MASK)0x00FF;
22481  SYS_PORTS_Clear( MY_PORTS_INSTANCE, MY_CHANNEL, clearMask );
22482  </code>
22483  Remarks:
22484  Not all features are available on all devices. Refer to the specific device
22485  data sheet for availability.
22486 */
22487 
22488 void
22489  SYS_PORTS_Clear (
22490  PORTS_MODULE_ID index ,
22491  PORTS_CHANNEL channel ,
22492  PORTS_DATA_MASK clearMask ) ;
22493 // *****************************************************************************
22494 /* Function:
22495  void SYS_PORTS_DirectionSelect( PORTS_MODULE_ID index,
22496  SYS_PORTS_PIN_DIRECTION pinDir,
22497  PORTS_CHANNEL channel,
22498  PORTS_DATA_MASK mask )
22499  Summary:
22500  Enables the direction for the selected port.
22501  <p><b>Implementation:</b> Dynamic</p>
22502  Description:
22503  This function enables the direction for the selected port.
22504  Preconditions:
22505  None.
22506  Parameters:
22507  index - Identifier for the device instance to be configured
22508  pinDir - Pin direction
22509  channel - Identifier for the PORT channel: A, B, C, etc.
22510  mask - Mask for the direction of width PORTS_DATA_MASK
22511  Returns:
22512  None
22513  Example:
22514  <code>
22515  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22516  // application developer.
22517  SYS_PORTS_PIN_DIRECTION pinDir;
22518  pinDir = SYS_PORTS_DIRECTION_INPUT;
22519  PORTS_DATA_MASK myMask = (PORTS_DATA_MASK)0x00FF;
22520  SYS_PORTS_DirectionSelect(MY_PORTS_INSTANCE, pinDir, MY_CHANNEL, myMask );
22521  </code>
22522  Remarks:
22523  None.
22524 */
22525 
22526 void
22528  PORTS_MODULE_ID index ,
22529  SYS_PORTS_PIN_DIRECTION pinDir ,
22530  PORTS_CHANNEL channel ,
22531  PORTS_DATA_MASK mask ) ;
22532 // *****************************************************************************
22533 /* Function:
22534  PORTS_DATA_MASK SYS_PORTS_DirectionGet( PORTS_MODULE_ID index, PORTS_CHANNEL channel )
22535  Summary:
22536  Reads the direction for the selected port.
22537  <p><b>Implementation:</b> Dynamic</p>
22538  Description:
22539  This function reads the direction for the selected port.
22540  Preconditions:
22541  None.
22542  Parameters:
22543  index - Identifier for the device instance to be configured
22544  channel - Identifier for the PORT channel: A, B, C, etc.
22545  Returns:
22546  Direction of the port.
22547  Example:
22548  <code>
22549  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22550  // application developer.
22551  PORTS_DATA_MASK value;
22552  value = SYS_PORTS_DirectionGet( MY_PORTS_INSTANCE, MY_CHANNEL );
22553  </code>
22554  Remarks:
22555  None.
22556 */
22557 
22560  PORTS_MODULE_ID index ,
22561  PORTS_CHANNEL channel ) ;
22562 // *****************************************************************************
22563 /* Function:
22564  void SYS_PORTS_Toggle( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
22565  PORTS_DATA_MASK toggleMask )
22566  Summary:
22567  Toggles the selected digital port pins.
22568  <p><b>Implementation:</b> Dynamic</p>
22569  Description:
22570  This function toggles the selected digital port pins.
22571  Preconditions:
22572  None.
22573  Parameters:
22574  index - Identifier for the device instance to be configured
22575  channel - Identifier for the PORT channel: A, B, C, etc.
22576  toggleMask - Identifies the bits to be toggled
22577  Returns:
22578  None.
22579  Example:
22580  <code>
22581  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22582  // application developer.
22583  PORTS_DATA_MASK toggleMask = (PORTS_DATA_MASK)0x00FF;
22584  SYS_PORTS_Toggle( MY_PORTS_INSTANCE, MY_CHANNEL, toggleMask );
22585  </code>
22586  Remarks:
22587  None.
22588 */
22589 
22590 void
22592  PORTS_MODULE_ID index ,
22593  PORTS_CHANNEL channel ,
22594  PORTS_DATA_MASK toggleMask ) ;
22595 // *****************************************************************************
22596 /* Function:
22597  void SYS_PORTS_OpenDrainEnable( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
22598  PORTS_DATA_MASK mask )
22599  Summary:
22600  Enables the open-drain functionality for the selected port.
22601  <p><b>Implementation:</b> Dynamic</p>
22602  Description:
22603  This function enables the open-drain functionality for the selected port.
22604  Preconditions:
22605  None.
22606  Parameters:
22607  index - Identifier for the device instance to be configured
22608  channel - Identifier for the PORT channel: A, B, C, etc.
22609  mask - Mask of type PORTS_DATA_MASK
22610  Returns:
22611  None.
22612  Example:
22613  <code>
22614  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22615  // application developer.
22616  SYS_PORTS_OpenDrainEnable( MY_PORTS_INSTANCE, MY_CHANNEL, (PORTS_DATA_MASK)0x00FF );
22617  </code>
22618  Remarks:
22619  Not all features are available on all devices. Refer to the specific device
22620  data sheet for availability.
22621 */
22622 
22623 void
22625  PORTS_MODULE_ID index ,
22626  PORTS_CHANNEL channel ,
22627  PORTS_DATA_MASK mask ) ;
22628 // *****************************************************************************
22629 /* Function:
22630  void SYS_PORTS_OpenDrainDisable( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
22631  PORTS_DATA_MASK mask )
22632  Summary:
22633  Disables the open-drain functionality for the selected port.
22634  <p><b>Implementation:</b> Dynamic</p>
22635  Description:
22636  This function disables the open-drain functionality for the selected port.
22637  Preconditions:
22638  None.
22639  Parameters:
22640  index - Identifier for the device instance to be configured
22641  channel - Identifier for the PORT channel: A, B, C, etc.
22642  mask - Mask of type PORTS_DATA_MASK
22643  Returns:
22644  None.
22645  Example:
22646  <code>
22647  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22648  // application developer.
22649  SYS_PORTS_PeripheralOpenDrainDisable( MY_PORTS_INSTANCE, MY_CHANNEL, (PORTS_DATA_MASK)0x00FF );
22650  </code>
22651  Remarks:
22652  Not all features are available on all devices. Refer to the specific device
22653  data sheet for availability.
22654 */
22655 
22656 void
22658  PORTS_MODULE_ID index ,
22659  PORTS_CHANNEL channel ,
22660  PORTS_DATA_MASK mask ) ;
22661 // *****************************************************************************
22662 /* Function:
22663  PORTS_DATA_TYPE SYS_PORTS_InterruptStatusGet
22664  (
22665  PORTS_MODULE_ID index,
22666  PORTS_CHANNEL channel
22667  )
22668  Summary:
22669  Reads the interrupt status from the I/O port.
22670  <p><b>Implementation:</b> Dynamic</p>
22671  Description:
22672  This function reads the interrupt status from the I/O port.
22673  Preconditions:
22674  The interrupts should have been configured.
22675  Parameters:
22676  index - Identifier for the device instance to be configured
22677  channel - Identifier for the PORT channel: A, B, C, etc.
22678  Returns:
22679  Returns the interrupt status of the port channel.
22680  Example:
22681  <code>
22682  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22683  // application developer.
22684  PORTS_DATA_TYPE channelStatus;
22685  channelStatus = SYS_PORTS_InterruptStatusGet( MY_PORTS_INSTANCE, MY_CHANNEL );
22686  </code>
22687  Remarks:
22688  None.
22689 */
22690 
22693  PORTS_MODULE_ID index ,
22694  PORTS_CHANNEL channel ) ;
22695 // *****************************************************************************
22696 // *****************************************************************************
22697 // Section: SYS PORT PINS REMAPING Routines
22698 // *****************************************************************************
22699 // *****************************************************************************
22700 // *****************************************************************************
22701 /* Function:
22702  void SYS_PORTS_RemapInput( PORTS_MODULE_ID index,
22703  PORTS_REMAP_INPUT_FUNCTION function,
22704  PORTS_REMAP_INPUT_PIN remapPin )
22705  Summary:
22706  Input/Output (I/O) function remapping.
22707  <p><b>Implementation:</b> Dynamic</p>
22708  Description:
22709  This function controls the I/O function remapping.
22710  Precondition:
22711  None.
22712  Parameters:
22713  index - Identifier for the device instance to be configured
22714  function - One of the possible values of PORTS_REMAP_INPUT_FUNCTION
22715  remapPin - One of the possible values of PORTS_REMAP_INPUT_PIN
22716  Returns:
22717  None.
22718  Example:
22719  <code>
22720  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22721  // application developer.
22722  // Remapping input function 'Input Capture 1' to the Remappable pin 'RPD2'
22723  SYS_PORTS_RemapInput(MY_PORTS_INSTANCE, INPUT_FUNC_IC1, INPUT_PIN_RPD2 );
22724  </code>
22725  Remarks:
22726  This feature may not be available on all devices. Please refer to the
22727  specific device data sheet to determine availability or use
22728  SYS_PORTS_ExistsRemapInputOutput in your application to determine whether
22729  this feature is available.
22730 */
22731 
22732 void
22734  PORTS_MODULE_ID index ,
22735  PORTS_REMAP_INPUT_FUNCTION function ,
22736  PORTS_REMAP_INPUT_PIN remapPin ) ;
22737 // *****************************************************************************
22738 /* Function:
22739  void SYS_PORTS_RemapOutput( PORTS_MODULE_ID index,
22740  PORTS_REMAP_OUTPUT_FUNCTION function,
22741  PORTS_REMAP_OUTPUT_PIN remapPin )
22742  Summary:
22743  Input/Output (I/O) function remapping.
22744  <p><b>Implementation:</b> Dynamic</p>
22745  Description:
22746  This function controls the I/O function remapping.
22747  Precondition:
22748  None.
22749  Parameters:
22750  index - Identifier for the device instance to be configured
22751  function - One of the possible values of PORTS_REMAP_OUTPUT_FUNCTION
22752  remapPin - One of the possible values of PORTS_REMAP_OUTPUT_PIN
22753  Returns:
22754  None.
22755  Example:
22756  <code>
22757  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22758  // application developer.
22759  // Remapping output function 'UART3 Transmit' to the Remappable pin 'RPA14'
22760  SYS_PORTS_RemapInputOutput(MY_PORTS_INSTANCE, OUTPUT_FUNC_U3TX, OUTPUT_PIN_RPA14);
22761  </code>
22762  Remarks:
22763  This feature may not be available on all devices. Please refer to the
22764  specific device data sheet to determine availability or use
22765  SYS_PORTS_ExistsRemapInputOutput in your application to determine whether
22766  this feature is available.
22767 */
22768 
22769 void
22771  PORTS_MODULE_ID index ,
22772  PORTS_REMAP_OUTPUT_FUNCTION function ,
22773  PORTS_REMAP_OUTPUT_PIN remapPin ) ;
22774 // *****************************************************************************
22775 // *****************************************************************************
22776 // Section: SYS Change Notification Pins Routines
22777 // *****************************************************************************
22778 // *****************************************************************************
22779 // *****************************************************************************
22780 /* Function:
22781  void SYS_PORTS_ChangeNotificationGlobalEnable( PORTS_MODULE_ID index )
22782  Summary:
22783  Globally enables the change notification for the selected port.
22784  <p><b>Implementation:</b> Dynamic</p>
22785  Description:
22786  This function globally enables the change notification for the selected port.
22787  Preconditions:
22788  None.
22789  Parameters:
22790  None.
22791  Returns:
22792  None.
22793  Example:
22794  <code>
22795  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22796  // application developer.
22797  SYS_PORTS_ChangeNotificationGlobalEnable( MY_PORTS_INSTANCE );
22798  </code>
22799  Remarks:
22800  Not all features are available on all devices. Refer to the specific device
22801  data sheet for availability.
22802 */
22803 
22804 void
22806  PORTS_MODULE_ID index ) ;
22807 // *****************************************************************************
22808 /* Function:
22809  void SYS_PORTS_ChangeNotificationGlobalDisable( PORTS_MODULE_ID index );
22810  Summary:
22811  Globally disables the change notification for the selected port.
22812  <p><b>Implementation:</b> Dynamic</p>
22813  Description:
22814  This function globally disables the change notification for the selected port.
22815  Preconditions:
22816  None.
22817  Parameters:
22818  None.
22819  Returns:
22820  None.
22821  Example:
22822  <code>
22823  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22824  // application developer.
22825  SYS_PORTS_ChangeNotificationGlobalDisable( MY_PORTS_INSTANCE);
22826  </code>
22827  Remarks:
22828  Not all features are available on all devices. Refer to the specific device
22829  data sheet for availability.
22830 */
22831 
22832 void
22834  PORTS_MODULE_ID index ) ;
22835 // *****************************************************************************
22836 /* Function:
22837  void SYS_PORTS_ChangeNotificationEnable( PORTS_MODULE_ID index,
22838  PORTS_CHANGE_NOTICE_PIN pinNum,
22839  SYS_PORTS_PULLUP_PULLDOWN_STATUS value )
22840  Summary:
22841  Enables the change notification for the selected port.
22842  <p><b>Implementation:</b> Dynamic</p>
22843  Description:
22844  This function enables the change notification for the selected port.
22845  Preconditions:
22846  None.
22847  Parameters:
22848  index - Identifier for the device instance to be configured
22849  value - Pull-up enable or disable value
22850  pinNum - Possible values of PORTS_CHANGE_NOTICE_PIN
22851  Returns:
22852  None.
22853  Example:
22854  <code>
22855  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22856  // application developer.
22857  SYS_PORTS_PULLUP_PULLDOWN_STATUS value;
22858  PORTS_CHANGE_NOTICE_PIN pinNum;
22859  SYS_PORTS_ChangeNotificationEnable( index, pinNum, value );
22860  </code>
22861  Remarks:
22862  Not all features are available on all devices. Refer to the specific device
22863  data sheet for availability.
22864 */
22865 
22866 void
22868  PORTS_MODULE_ID index ,
22869  PORTS_CHANGE_NOTICE_PIN pinNum ,
22871 // *****************************************************************************
22872 /* Function:
22873  void SYS_PORTS_ChangeNotificationDisable( PORTS_MODULE_ID index,
22874  PORTS_CHANGE_NOTICE_PIN pinNum )
22875  Summary:
22876  Disables the change notification for the selected port.
22877  <p><b>Implementation:</b> Dynamic</p>
22878  Description:
22879  This function disables the change notification for the selected port.
22880  Preconditions:
22881  None.
22882  Parameters:
22883  index - Identifier for the device instance to be configured
22884  pinNum - Possible values of PORTS_CHANGE_NOTICE_PIN
22885  Returns:
22886  None.
22887  Example:
22888  <code>
22889  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22890  // application developer.
22891  PORTS_CHANGE_NOTICE_PIN pinNum;
22892  SYS_PORTS_ChangeNotificationDisable( index, pinNum );
22893  </code>
22894  Remarks:
22895  Not all features are available on all devices. Refer to the specific device
22896  data sheet for availability.
22897 */
22898 
22899 void
22901  PORTS_MODULE_ID index ,
22902  PORTS_CHANGE_NOTICE_PIN pinNum ) ;
22903 // *****************************************************************************
22904 /* Function:
22905  void SYS_PORTS_ChangeNotificationInIdleModeEnable( PORTS_MODULE_ID index );
22906  Summary:
22907  Enables the change notification for the selected port in Sleep or Idle mode.
22908  <p><b>Implementation:</b> Dynamic</p>
22909  Description:
22910  This function enables the change notification for the selected port in Sleep
22911  or Idle mode.
22912  Preconditions:
22913  None.
22914  Parameters:
22915  None.
22916  Returns:
22917  None.
22918  Example:
22919  <code>
22920  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22921  // application developer.
22922  SYS_PORTS_ChangeNotificationInIdleModeEnable( MY_PORTS_INSTANCE );
22923  </code>
22924  Remarks:
22925  Not all features are available on all devices. Refer to the specific device
22926  data sheet for availability.
22927 */
22928 
22929 void
22931  PORTS_MODULE_ID index ) ;
22932 // *****************************************************************************
22933 /* Function:
22934  void SYS_PORTS_ChangeNotificationInIdleModeDisable( PORTS_MODULE_ID index);
22935  Summary:
22936  Disables the change notification for the selected port in Sleep or Idle mode.
22937  <p><b>Implementation:</b> Dynamic</p>
22938  Description:
22939  This function disables the change notification for the selected port in Sleep
22940  or Idle mode.
22941  Preconditions:
22942  None.
22943  Parameters:
22944  None.
22945  Returns:
22946  None.
22947  Example:
22948  <code>
22949  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22950  // application developer.
22951  SYS_PORTS_ChangeNotificationInIdleModeDisable( MY_PORTS_INSTANCE );
22952  </code>
22953  Remarks:
22954  Not all features are available on all devices. Refer to the specific device
22955  data sheet for availability.
22956 */
22957 
22958 void
22960  PORTS_MODULE_ID index ) ;
22961 // *****************************************************************************
22962 /* Function:
22963  void SYS_PORTS_ChangeNotificationPullUpEnable ( PORTS_MODULE_ID index,
22964  PORTS_CHANGE_NOTICE_PIN pinNum )
22965  Summary:
22966  Enables a weak pull-up on the change notification pin.
22967  <p><b>Implementation:</b> Dynamic</p>
22968  Description:
22969  This function enables a weak pull-up on the change notification pin.
22970  Preconditions:
22971  None.
22972  Parameters:
22973  index - Identifier for the device instance to be configured
22974  pinNum - Possible values of PORTS_CHANGE_NOTICE_PIN
22975  Returns:
22976  None.
22977  Example:
22978  <code>
22979  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22980  // application developer.
22981  // MY_PINNUM - PORTS_CHANGE_NOTICE_PIN_10
22982  SYS_PORTS_ChangeNotificationPullUpEnable( MY_PORTS_INSTANCE, MY_PINNUM );
22983  </code>
22984  Remarks:
22985  Not all features are available on all devices. Refer to the specific device
22986  data sheet for availability.
22987 */
22988 
22989 void
22991  PORTS_MODULE_ID index ,
22992  PORTS_CHANGE_NOTICE_PIN pinNum ) ;
22993 // *****************************************************************************
22994 /* Function:
22995  void SYS_PORTS_ChangeNotificationPullUpDisable ( PORTS_MODULE_ID index,
22996  PORTS_CHANGE_NOTICE_PIN pinNum )
22997  Summary:
22998  Disables a weak pull-up on the change notification pin.
22999  <p><b>Implementation:</b> Dynamic</p>
23000  Description:
23001  This function Disables a weak pull-up on the change notification pin.
23002  Preconditions:
23003  None.
23004  Parameters:
23005  index - Identifier for the device instance to be configured
23006  pinNum - Possible values of PORTS_CHANGE_NOTICE_PIN
23007  Returns:
23008  None.
23009  Example:
23010  <code>
23011  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
23012  // application developer.
23013  // MY_PINNUM - PORTS_CHANGE_NOTICE_PIN_10
23014  SYS_PORTS_ChangeNotificationPullUpDisable( MY_PORTS_INSTANCE, MY_PINNUM );
23015  </code>
23016  Remarks:
23017  Not all features are available on all devices. Refer to the specific device
23018  data sheet for availability.
23019 */
23020 
23021 void
23023  PORTS_MODULE_ID index ,
23024  PORTS_CHANGE_NOTICE_PIN pinNum ) ;
23025 // *****************************************************************************
23026 // *****************************************************************************
23027 // Section: SYS PORT PINS Control Routines
23028 // *****************************************************************************
23029 // *****************************************************************************
23030 // *****************************************************************************
23031 /* Function:
23032  void SYS_PORTS_PinModeSelect ( PORTS_MODULE_ID index,
23033  PORTS_ANALOG_PIN pin,
23034  PORTS_PIN_MODE mode)
23035  Summary:
23036  Enables the selected pin as analog or digital.
23037  <p><b>Implementation:</b> Dynamic</p>
23038  Description:
23039  This function enables the selected pin as analog or digital.
23040  Preconditions:
23041  None.
23042  Parameters:
23043  index - Identifier for the device instance to be configured
23044  pin - Possible values of PORTS_ANALOG_PIN
23045  mode - Possible values of PORTS_PIN_MODE
23046  Returns:
23047  None.
23048  Example:
23049  <code>
23050  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
23051  // application developer.
23052  // MY_PIN - PORTS_ANALOG_PIN_AN0
23053  // MY_PIN_MODE - PORTS_PIN_MODE_ANALOG
23054  SYS_PORTS_PinModSYS_PORTS_PinModeSelecteSelect( MY_PORTS_INSTANCE, MY_PIN, MY_PIN_MODE );
23055  </code>
23056  Remarks:
23057  Not all features are available on all devices. Refer to the specific device
23058  data sheet for availability.
23059 */
23060 
23061 void
23063  PORTS_MODULE_ID index ,
23064  PORTS_ANALOG_PIN pin ,
23065  PORTS_PIN_MODE mode ) ;
23066 // *****************************************************************************
23067 /* Function:
23068  void SYS_PORTS_PinWrite ( PORTS_MODULE_ID index,
23069  PORTS_CHANNEL channel,
23070  PORTS_BIT_POS bitPos
23071  bool value )
23072  Summary:
23073  Writes the selected digital pin.
23074  <p><b>Implementation:</b> Dynamic</p>
23075  Description:
23076  This function writes the selected digital pin.
23077  Preconditions:
23078  None.
23079  Parameters:
23080  index - Identifier for the device instance to be configured
23081  channel - Identifier for the PORT channel: A, B, C, etc.
23082  bitPos - Possible values of PORTS_BIT_POS
23083  value - Value to be written to the specific pin/latch:
23084  - true - Sets the bit
23085  - false - Clears the bit
23086  Returns:
23087  None.
23088  Example:
23089  <code>
23090  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
23091  // application developer.
23092  // MY_PINNUM - PORTS_PIN_10
23093  SYS_PORTS_PinWrite(MY_PORTS_INSTANCE, MY_CHANNEL, MY_PINNUM, value);
23094  </code>
23095  Remarks:
23096  Not all features are available on all devices. Refer to the specific device
23097  data sheet for availability.
23098 */
23099 
23100 void
23102  PORTS_MODULE_ID index ,
23103  PORTS_CHANNEL channel ,
23104  PORTS_BIT_POS bitPos ,
23105  bool value ) ;
23106 // *****************************************************************************
23107 /* Function:
23108  bool SYS_PORTS_PinLatchedGet ( PORTS_MODULE_ID index,
23109  PORTS_CHANNEL channel,
23110  PORTS_BIT_POS bitPos )
23111  Summary:
23112  Reads the data driven on the selected digital pin.
23113  <p><b>Implementation:</b> Dynamic</p>
23114  Description:
23115  This function reads the data driven on the selected
23116  digital output pin.
23117  Preconditions:
23118  None.
23119  Parameters:
23120  index - Identifier for the device instance to be configured
23121  channel - Identifier for the PORT channel: A, B, C, etc.
23122  bitPos - Possible values of PORTS_BIT_POS
23123  Returns:
23124  The status of the data driven on the port pin.
23125  Example:
23126  <code>
23127  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
23128  // application developer.
23129  // MY_PINNUM - PORTS_PIN_10
23130  status = SYS_PORTS_PinLatchedGet(MY_PORTS_INSTANCE, MY_CHANNEL, MY_PINNUM);
23131  </code>
23132  Remarks:
23133  Not all features are available on all devices. Refer to the specific device
23134  data sheet for availability.
23135 */
23136 
23137 bool
23139  PORTS_MODULE_ID index ,
23140  PORTS_CHANNEL channel ,
23141  PORTS_BIT_POS bitPos ) ;
23142 // *****************************************************************************
23143 /* Function:
23144  bool SYS_PORTS_PinRead ( PORTS_MODULE_ID index,
23145  PORTS_CHANNEL channel,
23146  PORTS_BIT_POS bitPos )
23147  Summary:
23148  Reads the selected digital pin.
23149  <p><b>Implementation:</b> Dynamic</p>
23150  Description:
23151  This function reads the selected digital pin, not the Latch.
23152  Preconditions:
23153  None.
23154  Parameters:
23155  index - Identifier for the device instance to be configured
23156  channel - Identifier for the PORT channel: A, B, C, etc.
23157  bitPos - Possible values of PORTS_BIT_POS
23158  Returns:
23159  The status of the port pin.
23160  Example:
23161  <code>
23162  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
23163  // application developer.
23164  // MY_PINNUM - PORTS_PIN_10
23165  bool bitStatus = SYS_PORTS_PinRead(MY_PORTS_INSTANCE, MY_CHANNEL, MY_PINNUM);
23166  </code>
23167  Remarks:
23168  Not all features are available on all devices. Refer to the specific device
23169  data sheet for availability.
23170 */
23171 
23172 bool
23174  PORTS_MODULE_ID index ,
23175  PORTS_CHANNEL channel ,
23176  PORTS_BIT_POS bitPos ) ;
23177 // *****************************************************************************
23178 /* Function:
23179  void SYS_PORTS_PinToggle ( PORTS_MODULE_ID index,
23180  PORTS_CHANNEL channel,
23181  PORTS_BIT_POS bitPos )
23182  Summary:
23183  Toggles the selected digital pin.
23184  <p><b>Implementation:</b> Dynamic</p>
23185  Description:
23186  This function toggles the selected digital pin.
23187  Preconditions:
23188  None.
23189  Parameters:
23190  index - Identifier for the device instance to be configured
23191  channel - Identifier for the PORT channel: A, B, C, etc.
23192  bitPos - Possible values of PORTS_BIT_POS
23193  Returns:
23194  None.
23195  Example:
23196  <code>
23197  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
23198  // application developer.
23199  // MY_PINNUM - PORTS_PIN_10
23200  SYS_PORTS_PinToggle( MY_PORTS_INSTANCE, MY_CHANNEL, MY_PINNUM );
23201  </code>
23202  Remarks:
23203  Not all features are available on all devices. Refer to the specific device
23204  data sheet for availability.
23205 */
23206 
23207 void
23209  PORTS_MODULE_ID index ,
23210  PORTS_CHANNEL channel ,
23211  PORTS_BIT_POS bitPos ) ;
23212 // *****************************************************************************
23213 /* Function:
23214  void SYS_PORTS_PinSet( PORTS_MODULE_ID index,
23215  PORTS_CHANNEL channel,
23216  PORTS_BIT_POS bitPos )
23217  Summary:
23218  Sets the selected digital pin/latch.
23219  <p><b>Implementation:</b> Dynamic</p>
23220  Description:
23221  This function sets the selected digital pin/latch.
23222  Preconditions:
23223  None.
23224  Parameters:
23225  index - Identifier for the device instance to be configured
23226  channel - Identifier for the PORT channel: A, B, C, etc.
23227  bitPos - Possible values of PORTS_BIT_POS
23228  Returns:
23229  None.
23230  Example:
23231  <code>
23232  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
23233  // application developer.
23234  // MY_PINNUM - PORTS_PIN_10
23235  SYS_PORTS_PinSet(MY_PORTS_INSTANCE, MY_CHANNEL, MY_PINNUM);
23236  </code>
23237  Remarks:
23238  Not all features are available on all devices. Refer to the specific device
23239  data sheet for availability.
23240 */
23241 
23242 void
23244  PORTS_MODULE_ID index ,
23245  PORTS_CHANNEL channel ,
23246  PORTS_BIT_POS bitPos ) ;
23247 // *****************************************************************************
23248 /* Function:
23249  void SYS_PORTS_PinClear ( PORTS_MODULE_ID index,
23250  PORTS_CHANNEL channel,
23251  PORTS_BIT_POS bitPos )
23252  Summary:
23253  Clears the selected digital pin.
23254  <p><b>Implementation:</b> Dynamic</p>
23255  Description:
23256  This function clears the selected digital pin.
23257  Preconditions:
23258  None.
23259  Parameters:
23260  index - Identifier for the device instance to be configured
23261  channel - Identifier for the PORT channel: A, B, C, etc.
23262  bitPos - Possible values of PORTS_BIT_POS
23263  Returns:
23264  None.
23265  Example:
23266  <code>
23267  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
23268  // application developer.
23269  // MY_PINNUM - PORTS_IO_PIN_10
23270  SYS_PORTS_PinClear( MY_PORTS_INSTANCE, MY_CHANNEL, MY_PINNUM );
23271  </code>
23272  Remarks:
23273  Not all features are available on all devices. Refer to the specific device
23274  data sheet for availability.
23275 */
23276 
23277 void
23279  PORTS_MODULE_ID index ,
23280  PORTS_CHANNEL channel ,
23281  PORTS_BIT_POS bitPos ) ;
23282 // *****************************************************************************
23283 /* Function:
23284  void SYS_PORTS_PinDirectionSelect ( PORTS_MODULE_ID index,
23285  SYS_PORTS_PIN_DIRECTION pinDir,
23286  PORTS_CHANNEL channel,
23287  PORTS_BIT_POS bitPos )
23288  Summary:
23289  Enables the direction for the selected pin.
23290  <p><b>Implementation:</b> Dynamic</p>
23291  Description:
23292  This function enables the direction for the selected pin.
23293  Preconditions:
23294  None.
23295  Parameters:
23296  index - Identifier for the device instance to be configured
23297  pinDir - Pin direction
23298  channel - Identifier for the PORT channel: A, B, C, etc.
23299  bitPos - Possible values of PORTS_BIT_POS
23300  Returns:
23301  None.
23302  Example:
23303  <code>
23304  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
23305  // application developer.
23306  // MY_PINNUM - PORTS_PIN_10
23307  SYS_PORTS_PIN_DIRECTION pinDir;
23308  pinDir = SYS_PORTS_DIRECTION_INPUT;
23309  SYS_PORTS_PinDirectionSelect(MY_PORTS_INSTANCE, pinDir, MY_CHANNEL, MY_PINNUM);
23310  </code>
23311  Remarks:
23312  Not all features are available on all devices. Refer to the specific device
23313  data sheet for availability.
23314 */
23315 
23316 void
23318  PORTS_MODULE_ID index ,
23319  SYS_PORTS_PIN_DIRECTION pinDir ,
23320  PORTS_CHANNEL channel ,
23321  PORTS_BIT_POS bitPos ) ;
23322 // *****************************************************************************
23323 /* Function:
23324  void SYS_PORTS_PinOpenDrainEnable ( PORTS_MODULE_ID index,
23325  PORTS_CHANNEL channel,
23326  PORTS_BIT_POS bitPos )
23327  Summary:
23328  Enables the open-drain functionality for the selected pin.
23329  <p><b>Implementation:</b> Dynamic</p>
23330  Description:
23331  This function enables the open-drain functionality for the selected pin.
23332  Preconditions:
23333  None.
23334  Parameters:
23335  index - Identifier for the device instance to be configured
23336  channel - Identifier for the PORT channel: A, B, C, etc.
23337  bitPos - Possible values of PORTS_BIT_POS
23338  Returns:
23339  None.
23340  Example:
23341  <code>
23342  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
23343  // application developer.
23344  // MY_PINNUM - PORTS_PIN_10
23345  SYS_PORTS_PinOpenDrainEnable( MY_PORTS_INSTANCE, MY_CHANNEL, MY_PINNUM );
23346  </code>
23347  Remarks:
23348  Not all features are available on all devices. Refer to the specific device
23349  data sheet for availability.
23350 */
23351 
23352 void
23354  PORTS_MODULE_ID index ,
23355  PORTS_CHANNEL channel ,
23356  PORTS_BIT_POS bitPos ) ;
23357 // *****************************************************************************
23358 /* Function:
23359  void SYS_PORTS_PinOpenDrainDisable ( PORTS_MODULE_ID index,
23360  PORTS_CHANNEL channel,
23361  PORTS_BIT_POS bitPos )
23362  Summary:
23363  Disables the open-drain functionality for the selected pin.
23364  <p><b>Implementation:</b> Dynamic</p>
23365  Description:
23366  This function disables the open-drain functionality for the selected pin.
23367  Preconditions:
23368  None.
23369  Parameters:
23370  index - Identifier for the device instance to be configured
23371  channel - Identifier for the PORT channel: A, B, C, etc.
23372  bitPos - Possible values of PORTS_BIT_POS
23373  Returns:
23374  None.
23375  Example:
23376  <code>
23377  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
23378  // application developer.
23379  // MY_PINNUM - PORTS_PIN_10
23380  SYS_PORTS_PinOpenDrainDisable(MY_PORTS_INSTANCE, MY_PINNUM);
23381  </code>
23382  Remarks:
23383  Not all features are available on all devices. Refer to the specific device
23384  data sheet for availability.
23385 */
23386 
23387 void
23389  PORTS_MODULE_ID index ,
23390  PORTS_CHANNEL channel ,
23391  PORTS_BIT_POS bitPos ) ;
23392 // *****************************************************************************
23393 /* Function:
23394  void SYS_PORTS_PinPullUpEnable ( PORTS_MODULE_ID index,
23395  PORTS_CHANNEL channel,
23396  PORTS_BIT_POS bitPos )
23397  Summary:
23398  Enables the pull-up functionality for the selected pin.
23399  <p><b>Implementation:</b> Dynamic</p>
23400  Description:
23401  This function enables the pull-up functionality for the selected pin.
23402  Preconditions:
23403  None.
23404  Parameters:
23405  index - Identifier for the device instance to be configured
23406  channel - Identifier for the PORT channel: A, B, C, etc.
23407  bitPos - Possible values of PORTS_BIT_POS
23408  Returns:
23409  None.
23410  Example:
23411  <code>
23412  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
23413  // application developer.
23414  // MY_PINNUM - PORTS_PIN_10
23415  SYS_PORTS_PinPullUpEnable( MY_PORTS_INSTANCE, MY_CHANNEL, MY_PINNUM );
23416  </code>
23417  Remarks:
23418  Not all features are available on all devices. Refer to the specific device
23419  data sheet for availability.
23420 */
23421 
23422 void
23424  PORTS_MODULE_ID index ,
23425  PORTS_CHANNEL channel ,
23426  PORTS_BIT_POS bitPos ) ;
23427 // *****************************************************************************
23428 /* Function:
23429  void SYS_PORTS_PinPullUpDisable ( PORTS_MODULE_ID index,
23430  PORTS_CHANNEL channel,
23431  PORTS_BIT_POS bitPos )
23432  Summary:
23433  Disables the pull-up functionality for the selected pin.
23434  <p><b>Implementation:</b> Dynamic</p>
23435  Description:
23436  This function disables the pull-up functionality for the selected pin.
23437  Preconditions:
23438  None.
23439  Parameters:
23440  index - Identifier for the device instance to be configured
23441  channel - Identifier for the PORT channel: A, B, C, etc.
23442  bitPos - Possible values of PORTS_BIT_POS
23443  Returns:
23444  None.
23445  Example:
23446  <code>
23447  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
23448  // application developer.
23449  // MY_PINNUM - PORTS_PIN_10
23450  SYS_PORTS_PinPullUpDisable(MY_PORTS_INSTANCE, MY_PINNUM);
23451  </code>
23452  Remarks:
23453  Not all features are available on all devices. Refer to the specific device
23454  data sheet for availability.
23455 */
23456 
23457 void
23459  PORTS_MODULE_ID index ,
23460  PORTS_CHANNEL channel ,
23461  PORTS_BIT_POS bitPos ) ;
23462 // *****************************************************************************
23463 /* Function:
23464  void SYS_PORTS_PinPullDownEnable ( PORTS_MODULE_ID index,
23465  PORTS_CHANNEL channel,
23466  PORTS_BIT_POS bitPos )
23467  Summary:
23468  Enables the pull-down functionality for the selected pin.
23469  <p><b>Implementation:</b> Dynamic</p>
23470  Description:
23471  This function enables the pull-down functionality for the selected pin.
23472  Preconditions:
23473  None.
23474  Parameters:
23475  index - Identifier for the device instance to be configured
23476  channel - Identifier for the PORT channel: A, B, C, etc.
23477  bitPos - Possible values of PORTS_BIT_POS
23478  Returns:
23479  None.
23480  Example:
23481  <code>
23482  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
23483  // application developer.
23484  // MY_PINNUM - PORTS_PIN_10
23485  SYS_PORTS_PinPullDownEnable( MY_PORTS_INSTANCE, MY_CHANNEL, MY_PINNUM );
23486  </code>
23487  Remarks:
23488  Not all features are available on all devices. Refer to the specific device
23489  data sheet for availability.
23490 */
23491 
23492 void
23494  PORTS_MODULE_ID index ,
23495  PORTS_CHANNEL channel ,
23496  PORTS_BIT_POS bitPos ) ;
23497 // *****************************************************************************
23498 /* Function:
23499  void SYS_PORTS_PinPullDownDisable ( PORTS_MODULE_ID index,
23500  PORTS_CHANNEL channel,
23501  PORTS_BIT_POS bitPos )
23502  Summary:
23503  Disables the pull-down functionality for the selected pin.
23504  <p><b>Implementation:</b> Dynamic</p>
23505  Description:
23506  This function disables the pull-down functionality for the selected pin.
23507  Preconditions:
23508  None.
23509  Parameters:
23510  index - Identifier for the device instance to be configured
23511  channel - Identifier for the PORT channel: A, B, C, etc.
23512  bitPos - Possible values of PORTS_BIT_POS
23513  Returns:
23514  None.
23515  Example:
23516  <code>
23517  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
23518  // application developer.
23519  // MY_PINNUM - PORTS_PIN_10
23520  SYS_PORTS_PinPullDownDisable(MY_PORTS_INSTANCE, MY_PINNUM);
23521  </code>
23522  Remarks:
23523  Not all features are available on all devices. Refer to the specific device
23524  data sheet for availability.
23525 */
23526 
23527 void
23529  PORTS_MODULE_ID index ,
23530  PORTS_CHANNEL channel ,
23531  PORTS_BIT_POS bitPos ) ;
23532 //******************************************************************************
23533 /* Function:
23534  void SYS_PORTS_InterruptEnable
23535  (
23536  PORTS_MODULE_ID index,
23537  PORTS_CHANNEL channel,
23538  PORTS_BIT_POS bitPos,
23539  PORTS_PIN_INTERRUPT_TYPE pinInterruptType
23540  )
23541  Summary:
23542  Enables the selected interrupt for the selected port pin.
23543  Description:
23544  This function enables the selected interrupt for the selected port pin.
23545  Preconditions:
23546  Select the pull-up or pull-down as required.
23547  Parameters:
23548  index - Identifier for the device instance to be configured
23549  channel - Identifier for the PORT channel: A, B, C, etc.
23550  bitPos - Possible values of PORTS_BIT_POS
23551  pinInterruptType - Interrupt type from PORTS_PIN_INTERRUPT_TYPE set
23552  Returns:
23553  None.
23554  Example:
23555  <code>
23556  SYS_PORTS_InterruptEnable(MY_PORTS_INSTANCE, MY_PORTS_CHANNEL, MY_PORT_BIT_POS, PORTS_PIN_INTERRUPT_BOTH_EDGE );
23557  </code>
23558  Remarks:
23559  None.
23560 */
23561 
23562 void
23564  PORTS_MODULE_ID index ,
23565  PORTS_CHANNEL channel ,
23566  PORTS_BIT_POS bitPos ,
23567  PORTS_PIN_INTERRUPT_TYPE pinInterruptType ) ;
23568 //DOM-IGNORE-BEGIN
23569 //DOM-IGNORE-END
23570  //SYS_PORTS_H
23571 /*******************************************************************************
23572  End of File
23573 */
23574 
23575 #endif /*00 C:\microchip\harmony\v2_06\framework\system\ports\sys_ports.h*/
23576 /* CLOSE_FILE Include File */
23577 
23578 /* OPEN FILE C:\microchip\harmony\v2_06\framework\driver\spi\drv_spi.h */
23579 /*******************************************************************************
23580  SPI Driver Interface
23581  Company:
23582  Microchip Technology Inc.
23583  File Name:
23584  drv_spi.h
23585  Summary:
23586  SPI device driver interface file.
23587  Description:
23588  The SPI driver provides a simple interface to manage the SPI module.
23589  This file defines the interface definitions and prototypes for the SPI driver.
23590 *******************************************************************************/
23591 //DOM-IGNORE-BEGIN
23592 /*******************************************************************************
23593 Copyright (c) 2013-2014 released Microchip Technology Inc. All rights reserved.
23594 Microchip licenses to you the right to use, modify, copy and distribute
23595 Software only when embedded on a Microchip microcontroller or digital signal
23596 controller that is integrated into your product or third party product
23597 (pursuant to the sublicense terms in the accompanying license agreement).
23598 You should refer to the license agreement accompanying this Software for
23599 additional information regarding your rights and obligations.
23600 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
23601 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
23602 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
23603 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
23604 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
23605 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
23606 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
23607 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
23608 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
23609 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
23610 *******************************************************************************/
23611 //DOM-IGNORE-END
23612 #ifndef _DRV_SPI_H
23613 #define _DRV_SPI_H
23614 /* OPEN FILE C:\microchip\harmony\v2_06\framework\driver\spi\drv_spi_definitions.h */
23615 /*******************************************************************************
23616  SPI Driver Interface
23617  Company:
23618  Microchip Technology Inc.
23619  File Name:
23620  drv_spi_definitions.h
23621  Summary:
23622  SPI device driver interface file.
23623  Description:
23624  The SPI driver provides a simple interface to manage the SPI module.
23625  This file defines the interface definitions and prototypes for the SPI
23626  driver.
23627 *******************************************************************************/
23628 //DOM-IGNORE-BEGIN
23629 /*******************************************************************************
23630 Copyright (c) 2016 released Microchip Technology Inc. All rights reserved.
23631 Microchip licenses to you the right to use, modify, copy and distribute
23632 Software only when embedded on a Microchip microcontroller or digital signal
23633 controller that is integrated into your product or third party product
23634 (pursuant to the sublicense terms in the accompanying license agreement).
23635 You should refer to the license agreement accompanying this Software for
23636 additional information regarding your rights and obligations.
23637 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
23638 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
23639 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
23640 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
23641 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
23642 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
23643 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
23644 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
23645 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
23646 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
23647 *******************************************************************************/
23648 //DOM-IGNORE-END
23649 #ifndef _DRV_SPI_DEFINITIONS_H
23650 #define _DRV_SPI_DEFINITIONS_H
23651 // *****************************************************************************
23652 // *****************************************************************************
23653 // Section: Data Types
23654 // *****************************************************************************
23655 // *****************************************************************************
23656 #include <stdint.h>
23657 #include <stdbool.h>
23658 #include "C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\system_config.h" /* LDRA full path */
23659 #include "C:\microchip\harmony\v2_06\framework\driver\driver_common.h" // Common Driver Definitions /* LDRA full path */
23660 /* OPEN FILE C:\microchip\harmony\v2_06\framework\peripheral\spi\plib_spi.h */
23661 /*******************************************************************************
23662  SPI Peripheral Library Interface Header
23663  Company:
23664  Microchip Technology Inc.
23665  File Name:
23666  plib_spi.h
23667  Summary:
23668  SPI Peripheral Library Interface Header for common definitions.
23669  Description:
23670  This header file contains the function prototypes and definitions of
23671  the data types and constants that make up the interface to the SPI
23672  PLIB.
23673  *******************************************************************************/
23674 // DOM-IGNORE-BEGIN
23675 /*******************************************************************************
23676 Copyright 2013-2015 released Microchip Technology Inc. All rights reserved.
23677 Microchip licenses to you the right to use, modify, copy and distribute
23678 Software only when embedded on a Microchip microcontroller or digital signal
23679 controller that is integrated into your product or third party product
23680 (pursuant to the sublicense terms in the accompanying license agreement).
23681 You should refer to the license agreement accompanying this Software for
23682 additional information regarding your rights and obligations.
23683 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
23684 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
23685 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
23686 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
23687 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
23688 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
23689 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
23690 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
23691 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
23692 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
23693  *******************************************************************************/
23694 // DOM-IGNORE-END
23695 #ifndef _PLIB_SPI_H
23696 #define _PLIB_SPI_H
23697 // DOM-IGNORE-BEGIN
23698 // DOM-IGNORE-END
23699 // *****************************************************************************
23700 // *****************************************************************************
23701 // Section: Included Files (continued at end of file)
23702 // *****************************************************************************
23703 // *****************************************************************************
23704 /* This section lists the other files that are included in this file. However,
23705  please see the end of the file for additional implementation header files
23706  that are also included.
23707  */
23708 /* OPEN FILE C:\microchip\harmony\v2_06\framework\peripheral\spi\processor\spi_processor.h */
23709 //DOM-IGNORE-BEGIN
23710 /*******************************************************************************
23711 Copyright (c) 2011-2016 released Microchip Technology Inc. All rights reserved.
23712 Microchip licenses to you the right to use, modify, copy and distribute
23713 Software only when embedded on a Microchip microcontroller or digital signal
23714 controller that is integrated into your product or third party product
23715 (pursuant to the sublicense terms in the accompanying license agreement).
23716 You should refer to the license agreement accompanying this Software for
23717 additional information regarding your rights and obligations.
23718 SOFTWARE AND DOCUMENTATION ARE PROVIDED 'AS IS' WITHOUT WARRANTY OF ANY KIND,
23719 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
23720 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
23721 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
23722 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
23723 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
23724 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
23725 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
23726 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
23727 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
23728  *******************************************************************************/
23729 //DOM-IGNORE-END
23730 #ifndef _PLIB_SPI_PROCESSOR_H
23731 #define _PLIB_SPI_PROCESSOR_H
23732 #error "Can't find header"
23733 #endif /*00 C:\microchip\harmony\v2_06\framework\peripheral\spi\processor\spi_processor.h*/
23734 /* CLOSE_FILE Include File */
23735 
23736 // *****************************************************************************
23737 // *****************************************************************************
23738 // Section: Constants & Data Types
23739 // *****************************************************************************
23740 // *****************************************************************************
23741 // *****************************************************************************
23742 // *****************************************************************************
23743 // Section: SPI Peripheral Library Interface Routines
23744 // *****************************************************************************
23745 // *****************************************************************************
23746 //******************************************************************************
23747 /* Function:
23748  void PLIB_SPI_Enable( SPI_MODULE_ID index )
23749  Summary:
23750  Enables the SPI module.
23751  Description:
23752  This function enables the SPI module.
23753  This operation is atomic.
23754  Precondition:
23755  None.
23756  Parameters:
23757  index - Identifier for the device instance to be configured
23758  Returns:
23759  None.
23760  Example:
23761  <code>
23762  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
23763  // application developer.
23764  PLIB_SPI_Enable(MY_SPI_INSTANCE);
23765  </code>
23766  Remarks:
23767  The SCKx, SDOx, SDIx and SSx pins must be assigned to available RPn pins
23768  before use.
23769  This function implements an operation of the enable control feature. This
23770  feature may not be available on all devices. Please refer to the specific
23771  device data sheet to determine availability or use "PLIB_SPI_ExistsEnableControl"
23772  in your application to automatically determine whether this feature is available.
23773  */
23774 
23775 void
23776  PLIB_SPI_Enable (
23777  SPI_MODULE_ID index ) ;
23778 //******************************************************************************
23779 /* Function:
23780  void PLIB_SPI_Disable (SPI_MODULE_ID index)
23781  Summary:
23782  Disables the SPI module.
23783  Description:
23784  This function disables the SPI module.
23785  This operation is atomic.
23786  Precondition:
23787  None.
23788  Parameters:
23789  index - Identifier for the device instance to be configured
23790  Returns:
23791  None.
23792  Example:
23793  <code>
23794  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
23795  // application developer.
23796  PLIB_SPI_Disable(MY_SPI_INSTANCE);
23797  </code>
23798  Remarks:
23799  This function implements an operation of the enable control feature. This
23800  feature may not be available on all devices. Please refer to the specific
23801  device data sheet to determine availability or use "PLIB_SPI_ExistsEnableControl"
23802  in your application to automatically determine whether this feature is available.
23803  */
23804 
23805 void
23807  SPI_MODULE_ID index ) ;
23808 //******************************************************************************
23809 /* Function:
23810  void PLIB_SPI_StopInIdleEnable (SPI_MODULE_ID index)
23811  Summary:
23812  Discontinues module operation when the device enters Idle mode.
23813  Description:
23814  This function sets up the SPI module such that module operation is disabled
23815  when the device enters Idle mode.
23816  This operation is atomic.
23817  Precondition:
23818  None.
23819  Parameters:
23820  index - Identifier for the device instance to be configured
23821  Returns:
23822  None.
23823  Example:
23824  <code>
23825  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
23826  // application developer.
23827  PLIB_SPI_StopInIdleEnable(MY_SPI_INSTANCE);
23828  </code>
23829  Remarks:
23830  This function implements an operation of the stop in idle control feature.
23831  This feature may not be available on all devices. Please refer to the
23832  specific device data sheet to determine availability or use
23833  "PLIB_SPI_ExistsStopInIdleControl" in your application to automatically
23834  determine if this feature is available.
23835  */
23836 
23837 void
23839  SPI_MODULE_ID index ) ;
23840 //******************************************************************************
23841 /* Function:
23842  void PLIB_SPI_StopInIdleDisable (SPI_MODULE_ID index)
23843  Summary:
23844  Continues module operation when the device enters Idle mode.
23845  Description:
23846  This function sets up the SPI module such that module operation is continued
23847  when the device enters Idle mode.
23848  This operation is atomic.
23849  Precondition:
23850  None.
23851  Parameters:
23852  index - Identifier for the device instance to be configured
23853  Returns:
23854  None.
23855  Example:
23856  <code>
23857  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
23858  // application developer.
23859  PLIB_SPI_StopInIdleDisable(MY_SPI_INSTANCE);
23860  </code>
23861  Remarks:
23862  This function implements an operation of the stop in idle control feature.
23863  This feature may not be available on all devices. Please refer to the
23864  specific device data sheet to determine availability or use
23865  "PLIB_SPI_ExistsStopInIdleControl" in your application to determine whether
23866  this feature is available.
23867  */
23868 
23869 void
23871  SPI_MODULE_ID index ) ;
23872 //******************************************************************************
23873 /* Function:
23874  bool PLIB_SPI_ReceiverHasOverflowed (SPI_MODULE_ID index)
23875  Summary:
23876  Returns the current status of the SPI receiver overflow.
23877  Description:
23878  This function returns the current status of the SPI receiver overflow.
23879  This operation is atomic.
23880  Precondition:
23881  None.
23882  Parameters:
23883  index - Identifier for the device instance to be configured
23884  Returns:
23885  SPI receiver overflow status:
23886  - true - A new byte/word is completely received and discarded.
23887  The user software has not read the previous data in
23888  the SPI buffer register.
23889  - false - No Overflow has occurred
23890  Example:
23891  <code>
23892  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
23893  // application developer.
23894  bool overflowstate = PLIB_SPI_ReceiverHasOverflowed(MY_SPI_INSTANCE);
23895  </code>
23896  Remarks:
23897  This function implements an operation of the receiver overflow status feature.
23898  This feature may not be available on all devices. Please refer to the
23899  specific device data sheet to determine availability or use "PLIB_SPI_ExistsReceiverOverflow"
23900  in your application to automatically determine whether this feature is available.
23901  */
23902 
23903 bool
23905  SPI_MODULE_ID index ) ;
23906 //******************************************************************************
23907 /* Function:
23908  void PLIB_SPI_ReceiverOverflowClear(SPI_MODULE_ID index)
23909  Summary:
23910  Clears the SPI receive overflow flag.
23911  Description:
23912  This function clears the SPI receive overflow flag.
23913  This operation is atomic.
23914  Precondition:
23915  None.
23916  Parameters:
23917  index - Identifier for the device instance to be configured
23918  Returns:
23919  None.
23920  Example:
23921  <code>
23922  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
23923  // application developer.
23924  PLIB_SPI_ReceiverOverflowClear(MY_SPI_INSTANCE);
23925  </code>
23926  Remarks:
23927  This function implements an operation of the receiver overflow status feature.
23928  This feature may not be available on all devices. Please refer to the
23929  specific device data sheet to determine availability or use "PLIB_SPI_ExistsReceiverOverflow"
23930  in your application to automatically determine whether this feature is available.
23931  */
23932 
23933 void
23935  SPI_MODULE_ID index ) ;
23936 //******************************************************************************
23937 /* Function:
23938  bool PLIB_SPI_TransmitBufferIsFull (SPI_MODULE_ID index)
23939  Summary:
23940  Returns the current transmit buffer status of the SPI module.
23941  Description:
23942  This function returns the current transmit buffer status of the SPI module.
23943  This operation is atomic.
23944  Precondition:
23945  None.
23946  Parameters:
23947  index - Identifier for the device instance to be configured
23948  Returns:
23949  - true - Transmit not yet started, transmit buffer is full
23950  - false - Transmit started, transmit buffer is empty/not full
23951  Example:
23952  <code>
23953  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
23954  // application developer.
23955  bool buffullstate = PLIB_SPI_TransmitBufferIsFull (MY_SPI_INSTANCE);
23956  </code>
23957  Remarks:
23958  In Standard Buffer mode - automatically set in hardware when SPI buffer writes
23959  occur, loading the transmit buffer. Automatically cleared in hardware when
23960  the SPI module transfers data from the transmit buffer to the shift register.
23961  In Enhanced Buffer mode - automatically set in hardware when SPI buffer writes
23962  occur, loading the last available buffer. Automatically cleared in hardware
23963  when the buffer is available for writing.
23964  This function implements an operation of the transmit buffer status feature.
23965  This feature may not be available on all devices. Please refer to the
23966  specific device data sheet to determine availability or use "PLIB_SPI_ExistsTransmitBufferFullStatus"
23967  in your application to automatically determine whether this feature is available.
23968  */
23969 
23970 bool
23972  SPI_MODULE_ID index ) ;
23973 //******************************************************************************
23974 /* Function:
23975  bool PLIB_SPI_ReceiverBufferIsFull (SPI_MODULE_ID index)
23976  Summary:
23977  Returns the current status of the SPI receive buffer.
23978  Description:
23979  This function returns the current status of the SPI receive buffer.
23980  This operation is atomic.
23981  Precondition:
23982  None.
23983  Parameters:
23984  index - Identifier for the device instance to be configured
23985  Returns:
23986  Receiver Buffer Full Status:
23987  - true - Receive complete, receive buffer is full
23988  - false - Receive is not complete, receive buffer is empty
23989  Example:
23990  <code>
23991  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
23992  // application developer.
23993  bool receivefullstate = PLIB_SPI_ReceiverBufferIsFull (MY_SPI_INSTANCE);
23994  </code>
23995  Remarks:
23996  In Standard Buffer mode - automatically set in hardware when the SPI module
23997  transfers data from the shift register to the receive buffer. Automatically
23998  cleared in hardware when the core reads the SPI buffer, read in the receive buffer.
23999  In Enhanced Buffer mode - automatically set in hardware when the SPI module
24000  transfers data from the shift register to the receive buffer, filling the
24001  last unread buffer. Automatically cleared in hardware when a buffer is available
24002  for a transfer from the shift register.
24003  This function implements an operation of the receiver buffer status feature.
24004  This feature may not be available on all devices. Please refer to the
24005  specific device data sheet to determine availability or use "PLIB_SPI_ExistsReceiveBufferStatus"
24006  in your application to automatically determine whether this feature is available.
24007  */
24008 
24009 bool
24011  SPI_MODULE_ID index ) ;
24012 //******************************************************************************
24013 /* Function:
24014  void PLIB_SPI_PinEnable (SPI_MODULE_ID index,SPI_PIN pin)
24015  Summary:
24016  Enables the selected SPI pins.
24017  Description:
24018  This function enables the selected SPI pins.
24019  Precondition:
24020  None.
24021  Parameters:
24022  index - Identifier for the device instance to be configured
24023  pin - One of the SPI_PIN enumeration values as the SPI pin
24024  Returns:
24025  None.
24026  Example:
24027  <code>
24028  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24029  // application developer.
24030  PLIB_SPI_PinEnable(MY_SPI_INSTANCE, SPI_PIN_SLAVE_SELECT);
24031  </code>
24032  Remarks:
24033  This function implements an operation of the pin control feature.
24034  This feature may not be available on all devices. Please refer to the
24035  specific device data sheet to determine availability or use "PLIB_SPI_ExistsPinControl"
24036  in your application to automatically determine whether this feature is available.
24037  */
24038 
24039 void
24041  SPI_MODULE_ID index ,
24042  SPI_PIN pin ) ;
24043 //******************************************************************************
24044 /* Function:
24045  void PLIB_SPI_PinDisable (SPI_MODULE_ID index, SPI_PIN pin)
24046  Summary:
24047  Enables the selected SPI pins.
24048  Description:
24049  This function enables the selected SPI pins.
24050  Precondition:
24051  None.
24052  Parameters:
24053  index - Identifier for the device instance to be configured
24054  pin - One of the SPI_PIN enumeration values as the SPI pin
24055  Returns:
24056  None.
24057  Example:
24058  <code>
24059  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24060  // application developer.
24061  PLIB_SPI_PinDisable(MY_SPI_INSTANCE, SPI_PIN_SLAVE_SELECT);
24062  </code>
24063  Remarks:
24064  This function implements an operation of the pin control feature.
24065  This feature may not be available on all devices. Please refer to the
24066  specific device data sheet to determine availability or use "PLIB_SPI_ExistsPinControl"
24067  in your application to automatically determine whether this feature is available.
24068  */
24069 
24070 void
24072  SPI_MODULE_ID index ,
24073  SPI_PIN pin ) ;
24074 //******************************************************************************
24075 /* Function:
24076  void PLIB_SPI_CommunicationWidthSelect (SPI_MODULE_ID index,
24077  SPI_COMMUNICATION_WIDTH width )
24078  Summary:
24079  Selects the data width for the SPI communication.
24080  Description:
24081  This function selects the data width for the SPI communication.
24082  This operation is atomic.
24083  Precondition:
24084  None.
24085  Parameters:
24086  index - Identifier for the device instance to be configured
24087  width - One of the SPI_COMMUNICATION_WIDTH enumeration values as the
24088  SPI buffer width
24089  Returns:
24090  None.
24091  Example:
24092  <code>
24093  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24094  // application developer.
24095  PLIB_SPI_CommunicationWidthSelect(MY_SPI_INSTANCE, SPI_COMMUNICATION_WIDTH_8BITS);
24096  </code>
24097  Remarks:
24098  This function implements an operation of the communication width feature.
24099  This feature may not be available on all devices. Please refer to the
24100  specific device data sheet to determine availability or use "PLIB_SPI_ExistsCommunicationWidth"
24101  in your application to automatically determine whether this feature is available.
24102  */
24103 
24104 void
24106  SPI_MODULE_ID index ,
24107  SPI_COMMUNICATION_WIDTH width ) ;
24108 //******************************************************************************
24109 /* Function:
24110  void PLIB_SPI_AudioCommunicationWidthSelect (SPI_MODULE_ID index,
24111  SPI_AUDIO_COMMUNICATION_WIDTH width )
24112  Summary:
24113  Selects the data width for the SPI audio communication.
24114  Description:
24115  This function selects the data width for the SPI audio communication.
24116  This operation is atomic.
24117  Precondition:
24118  None.
24119  Parameters:
24120  index - Identifier for the device instance to be configured
24121  width - One of the SPI_AUDIO_COMMUNICATION_WIDTH enumeration values as the
24122  SPI buffer width
24123  Returns:
24124  None.
24125  Example:
24126  <code>
24127  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24128  // application developer.
24129  PLIB_SPI_AudioCommunicationWidthSelect(MY_SPI_INSTANCE,
24130  SPI_AUDIO_COMMUNICATION_32DATA_32FIFO_32CHANNEL);
24131  </code>
24132  Remarks:
24133  This mode is available only when PLIB_SPI_AudioProtocolEnable is enabled.
24134  This function implements an operation of the audio communication width feature.
24135  This feature may not be available on all devices. Please refer to the
24136  specific device data sheet to determine availability or use "PLIB_SPI_ExistsAudioCommunicationWidth"
24137  in your application to automatically determine whether this feature is available.
24138  */
24139 
24140 void
24142  SPI_MODULE_ID index ,
24143  SPI_AUDIO_COMMUNICATION_WIDTH mode ) ;
24144 //******************************************************************************
24145 /* Function:
24146  void PLIB_SPI_InputSamplePhaseSelect(SPI_MODULE_ID index,
24147  SPI_INPUT_SAMPLING_PHASE phase)
24148  Summary:
24149  Selects the SPI data input sample phase.
24150  Description:
24151  This function selects the input sampling phase in Master mode.
24152  Precondition:
24153  None.
24154  Parameters:
24155  index - Identifier for the device instance to be configured
24156  phase - One of the SPI_INPUT_SAMPLING_PHASE as the SPI input
24157  sampling phase
24158  Returns:
24159  None.
24160  Example:
24161  <code>
24162  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24163  // application developer.
24164  PLIB_SPI_InputSamplePhaseSelect(MY_SPI_INSTANCE, SPI_INPUT_SAMPLING_PHASE_IN_MIDDLE);
24165  </code>
24166  Remarks:
24167  This function implements an operation of the input sample phase feature.
24168  This feature may not be available on all devices. Please refer to the
24169  specific device data sheet to determine availability or use "PLIB_SPI_ExistsInputSamplePhase"
24170  in your application to automatically determine whether this feature is available.
24171  */
24172 
24173 void
24175  SPI_MODULE_ID index ,
24176  SPI_INPUT_SAMPLING_PHASE phase ) ;
24177 //******************************************************************************
24178 /* Function:
24179  void PLIB_SPI_OutputDataPhaseSelect (SPI_MODULE_ID index,
24180  SPI_OUTPUT_DATA_PHASE data)
24181  Summary:
24182  Selects serial output data change.
24183  Description:
24184  This function selects serial output data change.
24185  Precondition:
24186  None.
24187  Parameters:
24188  index - Identifier for the device instance to be configured
24189  data - One of the SPI_OUTPUT_DATA_PHASE enumeration values as the
24190  SPI serial output data change
24191  Returns:
24192  None.
24193  Example:
24194  <code>
24195  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24196  // application developer.
24197  PLIB_SPI_OutputDataPhaseSelect(MY_SPI_INSTANCE, SPI_OUTPUT_DATA_PHASE_ON_ACTIVE_TO_IDLE_CLOCK);
24198  </code>
24199  Remarks:
24200  This function implements an operation of the output data phase feature.
24201  This feature may not be available on all devices. Please refer to the
24202  specific device data sheet to determine availability or use "PLIB_SPI_ExistsOutputDataPhase"
24203  in your application to automatically determine whether this feature is available.
24204  */
24205 
24206 void
24208  SPI_MODULE_ID index ,
24209  SPI_OUTPUT_DATA_PHASE phase ) ;
24210 //******************************************************************************
24211 /* Function:
24212  void PLIB_SPI_ClockPolaritySelect(SPI_MODULE_ID index,
24213  SPI_CLOCK_POLARITY polarity)
24214  Summary:
24215  Enables clock polarity.
24216  Description:
24217  This function enables clock polarity.
24218  Precondition:
24219  None.
24220  Parameters:
24221  index - Identifier for the device instance to be configured
24222  polarity - One of the SPI_CLOCK_POLARITY enumeration values as the SPI clock polarity
24223  Returns:
24224  None.
24225  Example:
24226  <code>
24227  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24228  // application developer.
24229  PLIB_SPI_ClockPolaritySelect(MY_SPI_INSTANCE, SPI_CLOCK_POLARITY_IDLE_HIGH );
24230  </code>
24231  Remarks:
24232  This function implements an operation of the clock polarity feature.
24233  This feature may not be available on all devices. Please refer to the
24234  specific device data sheet to determine availability or use "PLIB_SPI_ExistsClockPolarity"
24235  in your application to automatically determine whether this feature is available.
24236  */
24237 
24238 void
24240  SPI_MODULE_ID index ,
24241  SPI_CLOCK_POLARITY polarity ) ;
24242 //******************************************************************************
24243 /* Function:
24244  void PLIB_SPI_MasterEnable(SPI_MODULE_ID index)
24245  Summary:
24246  Enables the SPI in Master mode.
24247  Description:
24248  This function enables the SPI in Master mode.
24249  This operation is atomic.
24250  Precondition:
24251  None.
24252  Parameters:
24253  index - Identifier for the device instance to be configured
24254  Returns:
24255  None.
24256  Example:
24257  <code>
24258  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24259  // application developer.
24260  PLIB_SPI_MasterEnable(MY_SPI_INSTANCE);
24261  </code>
24262  Remarks:
24263  This function implements an operation of the master enable control feature.
24264  This feature may not be available on all devices. Please refer to the
24265  specific device data sheet to determine availability or use "PLIB_SPI_ExistsMasterControl"
24266  in your application to automatically determine whether this feature is available.
24267  */
24268 
24269 void
24271  SPI_MODULE_ID index ) ;
24272 //******************************************************************************
24273 /* Function:
24274  void PLIB_SPI_SlaveEnable(SPI_MODULE_ID index)
24275  Summary:
24276  Enables the SPI in Slave mode.
24277  Description:
24278  This function enables the SPI in Slave mode.
24279  This operation is atomic.
24280  Precondition:
24281  None.
24282  Parameters:
24283  index - Identifier for the device instance to be configured
24284  Returns:
24285  None.
24286  Example:
24287  <code>
24288  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24289  // application developer.
24290  PLIB_SPI_SlaveEnable(MY_SPI_INSTANCE);
24291  </code>
24292  Remarks:
24293  This function implements an operation of the master enable control feature.
24294  This feature may not be available on all devices. Please refer to the
24295  specific device data sheet to determine availability or use "PLIB_SPI_ExistsMasterControl"
24296  in your application to automatically determine whether this feature is available.
24297  */
24298 
24299 void
24301  SPI_MODULE_ID index ) ;
24302 //******************************************************************************
24303 /* Function:
24304  void PLIB_SPI_BaudRateSet(SPI_MODULE_ID index, uint32_t clockFrequency,
24305  uint32_t baudRate )
24306  Summary:
24307  Sets the baud rate to the desired value.
24308  Description:
24309  This function sets the baud rate to the desired value.
24310  Precondition:
24311  None.
24312  Parameters:
24313  index - Identifier for the device instance to be configured
24314  clockFrequency - Clock frequency
24315  baudrate - Baud rate value
24316  Returns:
24317  None.
24318  Example:
24319  <code>
24320  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24321  // application developer.
24322  PLIB_SPI_BaudRateSet(MY_SPI_INSTANCE, MY_CLOCK_FREQUENCY, 9600);
24323  </code>
24324  Remarks:
24325  Setting a new baud rate value causes the baud rate timer to reset.
24326  This ensures that the baud rate timer does not have to overflow before
24327  outputting the new baud rate.
24328  If the system clock is changed during an active receive operation, a
24329  receive error or data loss may result. To avoid this issue, verify that
24330  no receptions are in progress before changing the system clock.
24331  This function implements an operation of the baud rate set feature.
24332  This feature may not be available on all devices. Please refer to the
24333  specific device data sheet to determine availability or use "PLIB_SPI_ExistsBaudRate"
24334  in your application to automatically determine whether this feature is available.
24335  */
24336 
24337 void
24339  SPI_MODULE_ID index ,
24340  uint32_t clockFrequency ,
24341  uint32_t baudRate ) ;
24342 //******************************************************************************
24343 /* Function:
24344  bool PLIB_SPI_IsBusy (SPI_MODULE_ID index)
24345  Summary:
24346  Returns the current SPI module activity status.
24347  Description:
24348  This function returns the current SPI module activity status.
24349  This operation is atomic.
24350  Precondition:
24351  None.
24352  Parameters:
24353  index - Identifier for the device instance to be configured
24354  Returns:
24355  - true - SPI module is currently busy with some transactions
24356  - false - SPI module is currently idle
24357  Example:
24358  <code>
24359  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24360  // application developer.
24361  bool status = PLIB_SPI_IsBusy(MY_SPI_INSTANCE);
24362  </code>
24363  Remarks:
24364  This function implements an operation of the bus status feature.
24365  This feature may not be available on all devices. Please refer to the
24366  specific device data sheet to determine availability or use "PLIB_SPI_ExistsBusStatus"
24367  in your application to automatically determine whether this feature is available.
24368  */
24369 
24370 bool
24371  PLIB_SPI_IsBusy (
24372  SPI_MODULE_ID index ) ;
24373 //******************************************************************************
24374 /* Function:
24375  bool PLIB_SPI_ReadDataIsSignExtended(SPI_MODULE_ID index)
24376  Summary:
24377  Returns the current status of the receive (RX) FIFO sign-extended data.
24378  Description:
24379  This function returns the current status of the receive (RX) FIFO
24380  sign-extended data.
24381  This operation is atomic.
24382  Precondition:
24383  None.
24384  Parameters:
24385  index - Identifier for the device instance to be configured
24386  Returns:
24387  - true - Data from RX FIFO is sign-extended
24388  - false - Data from RX FIFO is not sign-extended
24389  Example:
24390  <code>
24391  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24392  // application developer.
24393  bool Status = PLIB_SPI_ReadDataIsSignExtended(MY_SPI_INSTANCE);
24394  </code>
24395  Remarks:
24396  This function implements an operation of the data sign feature.
24397  This feature may not be available on all devices. Please refer to the
24398  specific device data sheet to determine availability or use "PLIB_SPI_ExistsReadDataSignStatus"
24399  in your application to automatically determine whether this feature is available.
24400  */
24401 
24402 bool
24404  SPI_MODULE_ID index ) ;
24405 //******************************************************************************
24406 /* Function:
24407  void PLIB_SPI_SlaveSelectEnable(SPI_MODULE_ID index)
24408  Summary:
24409  Enables Master mode slave select.
24410  Description:
24411  This function enables Master mode slave select.
24412  This operation is atomic.
24413  Precondition:
24414  None.
24415  Parameters:
24416  index - Identifier for the device instance to be configured
24417  Returns:
24418  None.
24419  Example:
24420  <code>
24421  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24422  // application developer.
24423  PLIB_SPI_SlaveSelectEnable(MY_SPI_INSTANCE);
24424  </code>
24425  Remarks:
24426  This feature does not support Framed SPI mode.
24427  This function implements an operation of the Master mode slave select feature.
24428  This feature may not be available on all devices. Please refer to the
24429  specific device data sheet to determine availability or use "PLIB_SPI_ExistsSlaveSelectControl"
24430  in your application to automatically determine whether this feature is available.
24431 
24432  To enable Slave mode slave select pin (SSEN), PLIB_SPI_PinEnable API can be used.
24433  */
24434 
24435 void
24437  SPI_MODULE_ID index ) ;
24438 //******************************************************************************
24439 /* Function:
24440  void PLIB_SPI_SlaveSelectDisable(SPI_MODULE_ID index)
24441  Summary:
24442  Disables Master mode slave select.
24443  Description:
24444  This function disables Master mode slave select.
24445  This operation is atomic.
24446  Precondition:
24447  None.
24448  Parameters:
24449  index - Identifier for the device instance to be configured
24450  Returns:
24451  None.
24452  Example:
24453  <code>
24454  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24455  // application developer.
24456  PLIB_SPI_SlaveSelectDisable(MY_SPI_INSTANCE);
24457  </code>
24458  Remarks:
24459  This feature does not support Framed SPI mode.
24460  This function implements an operation of the slave select feature.
24461  This feature may not be available on all devices. Please refer to the
24462  specific device data sheet to determine availability or use "PLIB_SPI_ExistsSlaveSelectControl"
24463  in your application to automatically determine whether this feature is available.
24464 
24465  To disable Slave mode slave select pin (SSEN), PLIB_SPI_PinDisable API can be used.
24466  */
24467 
24468 void
24470  SPI_MODULE_ID index ) ;
24471 //******************************************************************************
24472 /* Function:
24473  bool PLIB_SPI_TransmitUnderRunStatusGet(SPI_MODULE_ID index)
24474  Summary:
24475  Returns the current status of the transmit underrun.
24476  Description:
24477  This function returns the current status of the transmit underrun.
24478  This operation is atomic.
24479  Precondition:
24480  None.
24481  Parameters:
24482  index - Identifier for the device instance to be configured
24483  Returns:
24484  - true - Transmit buffer has encountered an underrun condition
24485  - false - Transmit buffer run has not encountered an underrun condition
24486  Example:
24487  <code>
24488  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24489  // application developer.
24490  bool Status = PLIB_SPI_TransmitUnderRunStatusGet(MY_SPI_INSTANCE);
24491  </code>
24492  Remarks:
24493  Valid in Framed Sync mode.
24494  This function implements an operation of the transmit underrun status feature.
24495  This feature may not be available on all devices. Please refer to the
24496  specific device data sheet to determine availability or use "PLIB_SPI_ExistsTransmitUnderRunStatus"
24497  in your application to automatically determine whether this feature is available.
24498  */
24499 
24500 bool
24502  SPI_MODULE_ID index ) ;
24503 //******************************************************************************
24504 /* Function:
24505  void PLIB_SPI_TransmitUnderRunStatusClear(SPI_MODULE_ID index)
24506  Summary:
24507  Clears the SPI transmit underrun flag.
24508  Description:
24509  This function clears the SPI transmit underrun flag.
24510  This operation is atomic.
24511  Precondition:
24512  None.
24513  Parameters:
24514  index - Identifier for the device instance to be configured
24515  Returns:
24516  None.
24517  Example:
24518  <code>
24519  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24520  // application developer.
24521  PLIB_SPI_TransmitUnderRunStatusClear(MY_SPI_INSTANCE);
24522  </code>
24523  Remarks:
24524  This function implements an operation of the transmit underrun status feature.
24525  This feature may not be available on all devices. Please refer to the
24526  specific device data sheet to determine availability or use "ExistsTransmitUnderRunStatus"
24527  in your application to automatically determine whether this feature is available.
24528  */
24529 
24530 void
24532  SPI_MODULE_ID index ) ;
24533 //******************************************************************************
24534 /* Function:
24535  bool PLIB_SPI_TransmitBufferIsEmpty (SPI_MODULE_ID index)
24536  Summary:
24537  Returns the current status of the transmit buffer.
24538  Description:
24539  This function returns the current status of the transmit buffer.
24540  This operation is atomic.
24541  Precondition:
24542  None.
24543  Parameters:
24544  index - Identifier for the device instance to be configured
24545  Returns:
24546  - true - Transmit buffer is empty
24547  - false - Transmit buffer is not empty
24548  Example:
24549  <code>
24550  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24551  // application developer.
24552  bool Status = PLIB_SPI_TransmitBufferIsEmpty(MY_SPI_INSTANCE);
24553  </code>
24554  Remarks:
24555  This function implements an operation of the transmit buffer empty status feature.
24556  This feature may not be available on all devices. Please refer to the
24557  specific device data sheet to determine availability or use "PLIB_SPI_ExistsTransmitBufferEmptyStatus"
24558  in your application to automatically determine whether this feature is available.
24559  */
24560 
24561 bool
24563  SPI_MODULE_ID index ) ;
24564 //******************************************************************************
24565 /* Function:
24566  void PLIB_SPI_FIFOEnable (SPI_MODULE_ID index)
24567  Summary:
24568  Enables the SPI enhanced buffer.
24569  Description:
24570  This function enables the SPI enhanced buffer.
24571  This operation is atomic.
24572  Precondition:
24573  None.
24574  Parameters:
24575  index - Identifier for the device instance to be configured
24576  Returns:
24577  None.
24578  Example:
24579  <code>
24580  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24581  // application developer.
24582  PLIB_SPI_FIFOEnable(MY_SPI_INSTANCE);
24583  </code>
24584  Remarks:
24585  This enables the enhanced buffer mode.
24586  This function implements an operation of the FIFO control feature.
24587  This feature may not be available on all devices. Please refer to the
24588  specific device data sheet to determine availability or use "PLIB_SPI_ExistsFIFOControl"
24589  in your application to automatically determine whether this feature is available.
24590  */
24591 
24592 void
24594  SPI_MODULE_ID index ) ;
24595 //******************************************************************************
24596 /* Function:
24597  void PLIB_SPI_FIFODisable (SPI_MODULE_ID index)
24598  Summary:
24599  Disables the SPI enhanced buffer.
24600  Description:
24601  This function disables the SPI enhanced buffer.
24602  This operation is atomic.
24603  Precondition:
24604  None.
24605  Parameters:
24606  index - Identifier for the device instance to be configured
24607  Returns:
24608  None.
24609  Example:
24610  <code>
24611  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24612  // application developer.
24613  PLIB_SPI_FIFODisable(MY_SPI_INSTANCE);
24614  </code>
24615  Remarks:
24616  Enables the legacy standard single buffer mode.
24617  This function implements an operation of the FIFO control feature.
24618  This feature may not be available on all devices. Please refer to the
24619  specific device data sheet to determine availability or use "PLIB_SPI_ExistsFIFOControl"
24620  in your application to automatically determine whether this feature is available.
24621  */
24622 
24623 void
24625  SPI_MODULE_ID index ) ;
24626 //******************************************************************************
24627 /* Function:
24628  uint8_t PLIB_SPI_FIFOCountGet (SPI_MODULE_ID index, SPI_FIFO_TYPE type)
24629  Summary:
24630  Reads the SPI Buffer Element Count bits for either receive or transmit.
24631  Description:
24632  This function reads the number of SPI transfers pending for Master mode
24633  and the number of unread SPI transfers for Slave mode.
24634  Precondition:
24635  None.
24636  Parameters:
24637  index - Identifier for the device instance to be configured
24638  type - One of the SPI_FIFO_TYPE enumeration values
24639  Returns:
24640  CountValue - Buffer element count bits
24641  Example:
24642  <code>
24643  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24644  // application developer.
24645  uint8_t count = PLIB_SPI_FIFOCountGet(MY_SPI_INSTANCE,SPI_FIFO_TYPE_TRANSMIT);
24646  </code>
24647  Remarks:
24648  Valid in Enhanced Buffer mode.
24649  This function implements an operation of the FIFO control feature.
24650  This feature may not be available on all devices. Please refer to the
24651  specific device data sheet to determine availability or use "PLIB_SPI_ExistsFIFOCount"
24652  in your application to automatically determine whether this feature is available.
24653  */
24654 
24655 uint8_t
24657  SPI_MODULE_ID index ,
24658  SPI_FIFO_TYPE type ) ;
24659 //******************************************************************************
24660 /* Function:
24661  bool PLIB_SPI_FIFOShiftRegisterIsEmpty (SPI_MODULE_ID index)
24662  Summary:
24663  Returns the current status of the SPI shift register.
24664  Description:
24665  This function returns the current status of the SPI shift register.
24666  This operation is atomic.
24667  Precondition:
24668  None.
24669  Parameters:
24670  index - Identifier for the device instance to be configured
24671  Returns:
24672  - true - SPI shift register is empty and ready to send or receive
24673  - false - SPI shift register is not empty
24674  Example:
24675  <code>
24676  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24677  // application developer.
24678  bool Status = PLIB_SPI_FIFOShiftRegisterIsEmpty(MY_SPI_INSTANCE);
24679  </code>
24680  Remarks:
24681  Valid in Enhanced Buffer mode.
24682  This function implements an operation of the FIFO status feature.
24683  This feature may not be available on all devices. Please refer to the
24684  specific device data sheet to determine availability or use "PLIB_SPI_ExistsFIFOShiftRegisterEmptyStatus"
24685  in your application to automatically determine whether this feature is available.
24686  */
24687 
24688 bool
24690  SPI_MODULE_ID index ) ;
24691 //******************************************************************************
24692 /* Function:
24693  bool PLIB_SPI_ReceiverFIFOIsEmpty (SPI_MODULE_ID index)
24694  Summary:
24695  Returns the current status of the SPI receive FIFO.
24696  Description:
24697  This function returns the current status of the SPI receive FIFO.
24698  This operation is atomic.
24699  Precondition:
24700  None.
24701  Parameters:
24702  index - Identifier for the device instance to be configured
24703  Returns:
24704  - true - Receive FIFO is empty
24705  - false - Receive FIFO is not empty
24706  Example:
24707  <code>
24708  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24709  // application developer.
24710  bool fifostate = PLIB_SPI_ReceiverFIFOIsEmpty (MY_SPI_INSTANCE);
24711  </code>
24712  Remarks:
24713  Valid in Enhanced Buffer mode.
24714  This function implements an operation of the FIFO status feature.
24715  This feature may not be available on all devices. Please refer to the
24716  specific device data sheet to determine availability or use "PLIB_SPI_ExistsReceiveFIFOStatus"
24717  in your application to automatically determine whether this feature is available.
24718  */
24719 
24720 bool
24722  SPI_MODULE_ID index ) ;
24723 //******************************************************************************
24724 /* Function:
24725  void PLIB_SPI_FIFOInterruptModeSelect (SPI_MODULE_ID index,
24726  SPI_FIFO_INTERRUPT mode)
24727  Summary:
24728  Selects the SPI buffer interrupt mode.
24729  Description:
24730  This function selects the SPI buffer interrupt mode from SPI_FIFO_INTERRUPT.
24731  Precondition:
24732  None.
24733  Parameters:
24734  index - Identifier for the device instance to be configured
24735  mode - One of the SPI_FIFO_INTERRUPT enumeration values as the SPI buffer
24736  interrupt mode
24737  Returns:
24738  None.
24739  Example:
24740  <code>
24741  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24742  // application developer.
24743  PLIB_SPI_FIFOInterruptModeSelect(MY_SPI_INSTANCE,
24744  SPI_FIFO_INTERRUPT_WHEN_TRANSMIT_BUFFER_IS_NOT_FULL);
24745  </code>
24746  Remarks:
24747  Valid in Enhanced Buffer mode.
24748  This function implements an operation of the FIFO interrupt feature.
24749  This feature may not be available on all devices. Please refer to the
24750  specific device data sheet to determine availability or use "PLIB_SPI_ExistsFIFOInterruptMode"
24751  in your application to automatically determine whether this feature is available.
24752  */
24753 
24754 void
24756  SPI_MODULE_ID index ,
24757  SPI_FIFO_INTERRUPT mode ) ;
24758 //******************************************************************************
24759 /* Function:
24760  void PLIB_SPI_FramedCommunicationEnable (SPI_MODULE_ID index)
24761  Summary:
24762  Enables framed SPI support.
24763  Description:
24764  This function enables framed SPI support.
24765  This operation is atomic.
24766  Precondition:
24767  None.
24768  Parameters:
24769  index - Identifier for the device instance to be configured
24770  Returns:
24771  None.
24772  Example:
24773  <code>
24774  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24775  // application developer.
24776  PLIB_SPI_FramedCommunicationEnable(MY_SPI_INSTANCE);
24777  </code>
24778  Remarks:
24779  This function implements an operation of the framed communication feature.
24780  This feature may not be available on all devices. Please refer to the
24781  specific device data sheet to determine availability or use "PLIB_SPI_ExistsFramedCommunication"
24782  in your application to automatically determine whether this feature is available.
24783  */
24784 
24785 void
24787  SPI_MODULE_ID index ) ;
24788 //******************************************************************************
24789 /* Function:
24790  void PLIB_SPI_FramedCommunicationDisable (SPI_MODULE_ID index)
24791  Summary:
24792  Disables framed SPI support.
24793  Description:
24794  This function disables framed SPI support.
24795  This operation is atomic.
24796  Precondition:
24797  None.
24798  Parameters:
24799  index - Identifier for the device instance to be configured
24800  Returns:
24801  None.
24802  Example:
24803  <code>
24804  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24805  // application developer.
24806  PLIB_SPI_FramedCommunicationDisable(MY_SPI_INSTANCE);
24807  </code>
24808  Remarks:
24809  This function implements an operation of the framed communication feature.
24810  This feature may not be available on all devices. Please refer to the
24811  specific device data sheet to determine availability or use "PLIB_SPI_ExistsFramedCommunication"
24812  in your application to automatically determine whether this feature is available.
24813  */
24814 
24815 void
24817  SPI_MODULE_ID index ) ;
24818 //******************************************************************************
24819 /* Function:
24820  void PLIB_SPI_FrameSyncPulseDirectionSelect (SPI_MODULE_ID index,
24821  SPI_FRAME_PULSE_DIRECTION direction)
24822  Summary:
24823  Selects the frame sync pulse direction.
24824  Description:
24825  This function selects the frame sync pulse direction.
24826  Precondition:
24827  None.
24828  Parameters:
24829  index - Identifier for the device instance to be configured
24830  direction - One of the SPI_FRAME_PULSE_DIRECTION enumeration values
24831  as the SPI frame sync pulse polarity
24832  Returns:
24833  None.
24834  Example:
24835  <code>
24836  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24837  // application developer.
24838  PLIB_SPI_FrameSyncPulseDirectionSelect(MY_SPI_INSTANCE, SPI_FRAME_PULSE_DIRECTION_INPUT );
24839  </code>
24840  Remarks:
24841  This function implements an operation of the framed communication feature.
24842  This feature may not be available on all devices. Please refer to the
24843  specific device data sheet to determine availability or use "PLIB_SPI_ExistsFrameSyncPulseDirection"
24844  in your application to automatically determine whether this feature is available.
24845  */
24846 
24847 void
24849  SPI_MODULE_ID index ,
24850  SPI_FRAME_PULSE_DIRECTION direction ) ;
24851 //******************************************************************************
24852 /* Function:
24853  void PLIB_SPI_FrameSyncPulsePolaritySelect (SPI_MODULE_ID index,
24854  SPI_FRAME_PULSE_POLARITY polarity)
24855  Summary:
24856  Selects the frame sync pulse polarity.
24857  Description:
24858  This function selects the frame sync pulse polarity.
24859  Precondition:
24860  None.
24861  Parameters:
24862  index - Identifier for the device instance to be configured
24863  polarity - One of the SPI_FRAME_PULSE_POLARITY enumeration values as the SPI frame
24864  sync pulse polarity
24865  Returns:
24866  None.
24867  Example:
24868  <code>
24869  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24870  // application developer.
24871  PLIB_SPI_FrameSyncPulsePolaritySelect(MY_SPI_INSTANCE, SPI_FRAME_PULSE_POLARITY_ACTIVE_HIGH );
24872  </code>
24873  Remarks:
24874  Available only for Frame mode.
24875  This function implements an operation of the framed communication feature.
24876  This feature may not be available on all devices. Please refer to the
24877  specific device data sheet to determine availability or use "PLIB_SPI_ExistsFrameSyncPulsePolarity"
24878  in your application to automatically determine whether this feature is available.
24879  */
24880 
24881 void
24883  SPI_MODULE_ID index ,
24884  SPI_FRAME_PULSE_POLARITY polarity ) ;
24885 //******************************************************************************
24886 /* Function:
24887  void PLIB_SPI_FrameSyncPulseEdgeSelect (SPI_MODULE_ID index,
24888  SPI_FRAME_PULSE_EDGE edge)
24889  Summary:
24890  Selects the frame sync pulse edge.
24891  Description:
24892  This function selects the frame sync pulse edge.
24893  Precondition:
24894  None.
24895  Parameters:
24896  index - Identifier for the device instance to be configured
24897  edge - One of the SPI_FRAME_PULSE_EDGE enumeration values as the
24898  SPI frame sync pulse edge
24899  Returns:
24900  None.
24901  Example:
24902  <code>
24903  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24904  // application developer.
24905  PLIB_SPI_FrameSyncPulseEdgeSelect(MY_SPI_INSTANCE,
24906  SPI_FRAME_PULSE_EDGE_COINCIDES_FIRST_BIT_CLOCK);
24907  </code>
24908  Remarks:
24909  This function implements an operation of the framed communication feature.
24910  This feature may not be available on all devices. Please refer to the
24911  specific device data sheet to determine availability or use "PLIB_SPI_ExistsFrameSyncPulseEdge"
24912  in your application to automatically determine whether this feature is available.
24913  */
24914 
24915 void
24917  SPI_MODULE_ID index ,
24918  SPI_FRAME_PULSE_EDGE edge ) ;
24919 //******************************************************************************
24920 /* Function:
24921  void PLIB_SPI_FrameSyncPulseWidthSelect (SPI_MODULE_ID index,
24922  SPI_FRAME_PULSE_WIDTH width)
24923  Summary:
24924  Sets the frame sync pulse width.
24925  Description:
24926  This function sets the frame sync pulse width.
24927  Precondition:
24928  None.
24929  Parameters:
24930  index - Identifier for the device instance to be configured
24931  edge - One of the SPI_FRAME_PULSE_WIDTH enumeration values as the SPI
24932  frame sync pulse width.
24933  Returns:
24934  None.
24935  Example:
24936  <code>
24937  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24938  // application developer.
24939  PLIB_SPI_FrameSyncPulseWidthSelect (MY_SPI_INSTANCE,SPI_FRAME_PULSE_WIDTH_ONE_WORD_LENGTH);
24940  </code>
24941  Remarks:
24942  Length of the word is dependent on the communication mode.
24943  This function implements an operation of the framed communication feature.
24944  This feature may not be available on all devices. Please refer to the
24945  specific device data sheet to determine availability or use "PLIB_SPI_ExistsFrameSyncPulseWidth"
24946  in your application to automatically determine whether this feature is available.
24947  */
24948 
24949 void
24951  SPI_MODULE_ID index ,
24952  SPI_FRAME_PULSE_WIDTH width ) ;
24953 //******************************************************************************
24954 /* Function:
24955  void PLIB_SPI_FrameSyncPulseCounterSelect (SPI_MODULE_ID index,
24956  SPI_FRAME_SYNC_PULSE pulse)
24957  Summary:
24958  Selects at which character the SPI frame sync pulse is generated.
24959  Description:
24960  This function selects at which character the SPI frame sync pulse is generated.
24961  Precondition:
24962  None.
24963  Parameters:
24964  index - Identifier for the device instance to be configured
24965  pulse - One of the SPI_FRAME_SYNC_PULSE enumeration values as the SPI
24966  frame sync pulse count
24967  Returns:
24968  None.
24969  Example:
24970  <code>
24971  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24972  // application developer.
24973  PLIB_SPI_FrameSyncPulseCounterSelect(MY_SPI_INSTANCE,
24974  SPI_FRAME_SYNC_PULSE_ON_EVERY_32_DATA_CHARACTER );
24975  </code>
24976  Remarks:
24977  This is valid only when PLIB_SPI_FramedCommunicationEnable is enabled.
24978  This function implements an operation of the framed communication feature.
24979  This feature may not be available on all devices. Please refer to the
24980  specific device data sheet to determine availability or use "PLIB_SPI_ExistsFrameSyncPulseCounter"
24981  in your application to automatically determine whether this feature is available.
24982  */
24983 
24984 void
24986  SPI_MODULE_ID index ,
24987  SPI_FRAME_SYNC_PULSE pulse ) ;
24988 //******************************************************************************
24989 /* Function:
24990  bool PLIB_SPI_FrameErrorStatusGet (SPI_MODULE_ID index)
24991  Summary:
24992  Returns the current status of the SPI frame error.
24993  Description:
24994  This function returns the current status of the SPI frame error.
24995  This operation is atomic.
24996  Precondition:
24997  None.
24998  Parameters:
24999  index - Identifier for the device instance to be configured
25000  Returns:
25001  - true - Frame error detected
25002  - false - No frame error detected
25003  Example:
25004  <code>
25005  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
25006  // application developer.
25007  bool status = PLIB_SPI_FrameErrorStatusGet(MY_SPI_INSTANCE);
25008  </code>
25009  Remarks:
25010  Valid only if Frame mode is enabled.
25011  This function implements an operation of the framed communication feature.
25012  This feature may not be available on all devices. Please refer to the
25013  specific device data sheet to determine availability or use "PLIB_SPI_ExistsFrameErrorStatus"
25014  in your application to automatically determine whether this feature is available.
25015  */
25016 
25017 bool
25019  SPI_MODULE_ID index ) ;
25020 //******************************************************************************
25021 /* Function:
25022  void PLIB_SPI_FrameErrorStatusClear(SPI_MODULE_ID index)
25023  Summary:
25024  Clears the SPI frame error flag.
25025  Description:
25026  This function clears the SPI frame error flag.
25027  This operation is atomic.
25028  Precondition:
25029  None.
25030  Parameters:
25031  index - Identifier for the device instance to be configured
25032  Returns:
25033  None.
25034  Example:
25035  <code>
25036  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
25037  // application developer.
25038  PLIB_SPI_FrameErrorStatusClear(MY_SPI_INSTANCE);
25039  </code>
25040  Remarks:
25041  This function implements an operation of the frame error status feature.
25042  This feature may not be available on all devices. Please refer to the
25043  specific device data sheet to determine availability or use "ExistsFrameErrorStatus"
25044  in your application to automatically determine whether this feature is available.
25045  */
25046 
25047 void
25049  SPI_MODULE_ID index ) ;
25050 //******************************************************************************
25051 /* Function:
25052  void PLIB_SPI_BufferClear (SPI_MODULE_ID index)
25053  Summary:
25054  Clears the SPI receive buffer.
25055  Description:
25056  This function clears the SPI receive buffer.
25057  In Enhanced Buffer mode, this functions clears the full RX FIFO.
25058  This operation is atomic.
25059  Precondition:
25060  None.
25061  Parameters:
25062  index - Identifier for the device instance to be configured
25063  Returns:
25064  None.
25065  Example:
25066  <code>
25067  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
25068  // application developer.
25069  //This call will flush the receive buffer.
25070  PLIB_SPI_BufferClear(MY_SPI_INSTANCE);
25071  </code>
25072  Remarks:
25073  This function implements an operation of the buffer control feature.
25074  This feature may not be available on all devices. Please refer to the
25075  specific device data sheet to determine availability or use "PLIB_SPI_ExistsBuffer"
25076  in your application to automatically determine whether this feature is available.
25077  */
25078 
25079 void
25081  SPI_MODULE_ID index ) ;
25082 //******************************************************************************
25083 /* Function:
25084  uint8_t PLIB_SPI_BufferRead (SPI_MODULE_ID index)
25085  Summary:
25086  Returns the SPI buffer value.
25087  Description:
25088  This function returns the SPI buffer value.
25089  This operation is atomic.
25090  Precondition:
25091  None.
25092  Parameters:
25093  index - Identifier for the device instance to be configured
25094  Returns:
25095  Reads the SPI buffer.
25096  Example:
25097  <code>
25098  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
25099  // application developer.
25100  uint8_t bufferValue = PLIB_SPI_BufferRead(MY_SPI_INSTANCE);
25101  </code>
25102  Remarks:
25103  This function implements an operation of the buffer control feature.
25104  This feature may not be available on all devices. Please refer to the
25105  specific device data sheet to determine availability or use "PLIB_SPI_ExistsBuffer"
25106  in your application to automatically determine whether this feature is available.
25107  */
25108 
25109 uint8_t
25111  SPI_MODULE_ID index ) ;
25112 //******************************************************************************
25113 /* Function:
25114  uint16_t PLIB_SPI_BufferRead16bit ( SPI_MODULE_ID index )
25115  Summary:
25116  Returns 16-bit SPI buffer value.
25117  Description:
25118  This function returns 16-bit SPI buffer value.
25119  This operation is atomic.
25120  Precondition:
25121  SPI 16-bit wide communication must be selected using PLIB_SPI_CommunicationWidthSelect.
25122  Parameters:
25123  index - Identifier for the device instance to be configured
25124  Returns:
25125  Returns the SPI 16-bit buffer value.
25126  Example:
25127  <code>
25128 #define MY_SPI_INSTANCE SPI_ID_1
25129 
25130  uint16_t bufferValue = PLIB_SPI_BufferRead16bit( MY_SPI_INSTANCE );
25131  </code>
25132  Remarks:
25133  This function implements an operation of the buffer control feature.
25134  This feature may not be available on all devices. Please refer to the
25135  specific device data sheet to determine availability or use "PLIB_SPI_Exists16bitBuffer"
25136  in your application to automatically determine whether this feature is available.
25137  */
25138 
25139 uint16_t
25141  SPI_MODULE_ID index ) ;
25142 //******************************************************************************
25143 /* Function:
25144  uint32_t PLIB_SPI_BufferRead32bit ( SPI_MODULE_ID index )
25145  Summary:
25146  Returns 32-bit SPI buffer value.
25147  Description:
25148  This function returns 32-bit SPI buffer value.
25149  This operation is atomic.
25150  Precondition:
25151  SPI 32-bit wide communication must be selected using PLIB_SPI_CommunicationWidthSelect.
25152  Parameters:
25153  index - Identifier for the device instance to be configured
25154  Returns:
25155  Returns the SPI 32-bit buffer value.
25156  Example:
25157  <code>
25158 #define MY_SPI_INSTANCE SPI_ID_1
25159 
25160  uint32_t bufferValue = PLIB_SPI_BufferRead32bit( MY_SPI_INSTANCE );
25161  </code>
25162  Remarks:
25163  This function implements an operation of the buffer control feature.
25164  This feature may not be available on all devices. Please refer to the
25165  specific device data sheet to determine availability or use "PLIB_SPI_Exists32bitBuffer"
25166  in your application to automatically determine whether this feature is available.
25167  */
25168 
25169 uint32_t
25171  SPI_MODULE_ID index ) ;
25172 //******************************************************************************
25173 /* Function:
25174  void PLIB_SPI_BufferWrite ( SPI_MODULE_ID index , uint8_t data )
25175  Summary:
25176  Write the data to the SPI buffer.
25177  Description:
25178  This function writes data to the SPI buffer.
25179  This operation is atomic.
25180  Precondition:
25181  None.
25182  Parameters:
25183  index - Identifier for the device instance to be configured
25184  data - Data to written to the SPI buffer
25185  Returns:
25186  None.
25187  Example:
25188  <code>
25189  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
25190  // application developer.
25191  PLIB_SPI_BufferWrite ( MY_SPI_INSTANCE, 0xFF );
25192  </code>
25193  Remarks:
25194  This function implements an operation of the buffer control feature.
25195  This feature may not be available on all devices. Please refer to the
25196  specific device data sheet to determine availability or use "PLIB_SPI_ExistsBuffer"
25197  in your application to automatically determine whether this feature is available.
25198  */
25199 
25200 void
25202  SPI_MODULE_ID index ,
25203  uint8_t data ) ;
25204 //******************************************************************************
25205 /* Function:
25206  void PLIB_SPI_BufferWrite16bit ( SPI_MODULE_ID index , uint16_t data )
25207  Summary:
25208  Writes 16-bit data to the SPI buffer.
25209  Description:
25210  This function writes 16-bit data to the SPI buffer.
25211  This operation is atomic.
25212  Precondition:
25213  SPI 16-bit wide communication must be selected using PLIB_SPI_CommunicationWidthSelect.
25214  Parameters:
25215  index - Identifier for the device instance to be configured
25216  data - 16-bit data to be written to the SPI buffer
25217  Returns:
25218  None.
25219  Example:
25220  <code>
25221 #define MY_SPI_INSTANCE SPI_ID_1
25222 
25223  PLIB_SPI_BufferWrite16bit ( MY_SPI_INSTANCE, 0x55AA );
25224  </code>
25225  Remarks:
25226  This function implements an operation of the buffer control feature.
25227  This feature may not be available on all devices. Please refer to the
25228  specific device data sheet to determine availability or use "PLIB_SPI_Exists16bitBuffer"
25229  in your application to automatically determine whether this feature is available.
25230  */
25231 
25232 void
25234  SPI_MODULE_ID index ,
25235  uint16_t data ) ;
25236 //******************************************************************************
25237 /* Function:
25238  void PLIB_SPI_BufferWrite32bit ( SPI_MODULE_ID index , uint32_t data )
25239  Summary:
25240  Write 32-bit data to the SPI buffer.
25241  Description:
25242  This function writes 32-bit data to the SPI buffer.
25243  This operation is atomic.
25244  Precondition:
25245  SPI 32-bit wide communication must be selected using PLIB_SPI_CommunicationWidthSelect.
25246  Parameters:
25247  index - Identifier for the device instance to be configured
25248  data - 32-bit data to be written to the SPI buffer
25249  Returns:
25250  None.
25251  Example:
25252  <code>
25253 #define MY_SPI_INSTANCE SPI_ID_1
25254 
25255  PLIB_SPI_BufferWrite ( MY_SPI_INSTANCE, 0x55AA55AA );
25256  </code>
25257  Remarks:
25258  This function implements an operation of the buffer control feature.
25259  This feature may not be available on all devices. Please refer to the
25260  specific device data sheet to determine availability or use "PLIB_SPI_Exists32bitBuffer"
25261  in your application to automatically determine whether this feature is available.
25262  */
25263 
25264 void
25266  SPI_MODULE_ID index ,
25267  uint32_t data ) ;
25268 //******************************************************************************
25269 /* Function : PLIB_SPI_BufferAddressGet( SPI_MODULE_ID index )
25270  Summary:
25271  Returns the address of the SPIxBUF (Transmit(SPIxTXB) and Receive (SPIxRXB))
25272  register.
25273  Description:
25274  This function returns the address of the SPIxBUF (Transmit(SPIxTXB) and Receive
25275  (SPIxRXB)) register.
25276  This operation is atomic.
25277  Preconditions:
25278  None.
25279  Parameters:
25280  index - Identifier for the device instance
25281  Returns:
25282  The address of the SPIxBUF register
25283  Remarks:
25284  None.
25285 */
25286 
25287 void *
25289  SPI_MODULE_ID index ) ;
25290 //******************************************************************************
25291 /* Function:
25292  void PLIB_SPI_BaudRateClockSelect (SPI_MODULE_ID index,
25293  SPI_BAUD_RATE_CLOCK type)
25294  Summary:
25295  Selects the type of clock is used by the Baud Rate Generator.
25296  Description:
25297  This function selects the type of clock is used by the Baud Rate Generator.
25298  Precondition:
25299  None.
25300  Parameters:
25301  index - Identifier for the device instance to be configured
25302  type - One of the SPI_BAUD_RATE_CLOCK enumeration values as the SPI baud clock
25303  Returns:
25304  None.
25305  Example:
25306  <code>
25307  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
25308  // application developer.
25309  PLIB_SPI_BaudRateClockSelect (MY_SPI_INSTANCE, SPI_BAUD_RATE_MCLK_CLOCK);
25310  </code>
25311  Remarks:
25312  This function implements an operation of the baud rate clock control feature.
25313  This feature may not be available on all devices. Please refer to the
25314  specific device data sheet to determine availability or use "PLIB_SPI_ExistsBaudRateClock"
25315  in your application to automatically determine whether this feature is available.
25316  */
25317 
25318 void
25320  SPI_MODULE_ID index ,
25321  SPI_BAUD_RATE_CLOCK type ) ;
25322 //******************************************************************************
25323 /* Function:
25324  void PLIB_SPI_ErrorInterruptEnable (SPI_MODULE_ID index,
25325  SPI_ERROR_INTERRUPT error)
25326  Summary:
25327  Enables SPI error interrupts
25328  Description:
25329  This function enables SPI error interrupts.
25330  Precondition:
25331  None.
25332  Parameters:
25333  index - Identifier for the device instance to be configured
25334  type - One of the SPI_ERROR_INTERRUPT enumeration values as the
25335  SPI interrupt error
25336  Returns:
25337  None.
25338  Example:
25339  <code>
25340  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
25341  // application developer.
25342  PLIB_SPI_ErrorInterruptEnable (MY_SPI_INSTANCE, SPI_ERROR_INTERRUPT_FRAME_ERROR_OVERFLOW);
25343  </code>
25344  Remarks:
25345  This function implements an operation of the error interrupt control feature.
25346  This feature may not be available on all devices. Please refer to the
25347  specific device data sheet to determine availability or use "PLIB_SPI_ExistsErrorInterruptControl"
25348  in your application to automatically determine whether this feature is available.
25349  */
25350 
25351 void
25353  SPI_MODULE_ID index ,
25354  SPI_ERROR_INTERRUPT error ) ;
25355 //******************************************************************************
25356 /* Function:
25357  void PLIB_SPI_ErrorInterruptDisable (SPI_MODULE_ID index,
25358  SPI_ERROR_INTERRUPT error)
25359  Summary:
25360  Enables SPI error interrupts.
25361  Description:
25362  This function enables SPI error interrupts.
25363  Precondition:
25364  None.
25365  Parameters:
25366  index - Identifier for the device instance to be configured
25367  error - One of the SPI_ERROR_INTERRUPT enumeration values as the
25368  SPI interrupt error
25369  Returns:
25370  None.
25371  Example:
25372  <code>
25373  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
25374  // application developer.
25375  PLIB_SPI_ErrorInterruptDisable (MY_SPI_INSTANCE, SPI_ERROR_INTERRUPT_FRAME_ERROR_OVERFLOW);
25376  </code>
25377  Remarks:
25378  This function implements an operation of the error interrupt control feature.
25379  This feature may not be available on all devices. Please refer to the
25380  specific device data sheet to determine availability or use "PLIB_SPI_ExistsErrorInterruptControl"
25381  in your application to automatically determine whether this feature is available.
25382  */
25383 
25384 void
25386  SPI_MODULE_ID index ,
25387  SPI_ERROR_INTERRUPT error ) ;
25388 //******************************************************************************
25389 /* Function:
25390  void PLIB_SPI_AudioErrorEnable (SPI_MODULE_ID index, SPI_Audio_ERROR error)
25391  Summary:
25392  Enables the SPI error.
25393  Description:
25394  This function enables the SPI error.
25395  This operation is atomic.
25396  Precondition:
25397  None.
25398  Parameters:
25399  index - Identifier for the device instance to be configured
25400  error - One of the SPI_AUDIO_ERROR enumeration values as the SPI error
25401  Returns:
25402  None.
25403  Example:
25404  <code>
25405  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
25406  // application developer.
25407  PLIB_SPI_AudioErrorEnable (MY_SPI_INSTANCE, SPI_AUDIO_ERROR_RECEIVE_OVERFLOW);
25408  </code>
25409  Remarks:
25410  This function implements an operation of the audio error control feature.
25411  This feature may not be available on all devices. Please refer to the
25412  specific device data sheet to determine availability or use "PLIB_SPI_ExistsAudioErrorControl"
25413  in your application to automatically determine whether this feature is available.
25414  */
25415 
25416 void
25418  SPI_MODULE_ID index ,
25419  SPI_AUDIO_ERROR error ) ;
25420 //******************************************************************************
25421 /* Function:
25422  void PLIB_SPI_AudioErrorDisable (SPI_MODULE_ID index, SPI_AUDIO_ERROR error)
25423  Summary:
25424  Disables the SPI error.
25425  Description:
25426  This function disables the SPI error.
25427  This operation is atomic.
25428  Precondition:
25429  None.
25430  Parameters:
25431  index - Identifier for the device instance to be configured
25432  error - One of the SPI_AUDIO_ERROR enumeration values as the SPI error
25433  Returns:
25434  None.
25435  Example:
25436  <code>
25437  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
25438  // application developer.
25439  PLIB_SPI_AudioErrorDisable (MY_SPI_INSTANCE, SPI_AUDIO_ERROR_RECEIVE_OVERFLOW);
25440  </code>
25441  Remarks:
25442  This function implements an operation of the audio error control feature.
25443  This feature may not be available on all devices. Please refer to the
25444  specific device data sheet to determine availability or use "PLIB_SPI_ExistsAudioErrorControl"
25445  in your application to automatically determine whether this feature is available.
25446  */
25447 
25448 void
25450  SPI_MODULE_ID index ,
25451  SPI_AUDIO_ERROR error ) ;
25452 //******************************************************************************
25453 /* Function:
25454  void PLIB_SPI_AudioProtocolEnable (SPI_MODULE_ID index)
25455  Summary:
25456  Audio protocol is enabled.
25457  Description:
25458  This function enables the audio protocol.
25459  This operation is atomic.
25460  Precondition:
25461  Disable the SPI module by calling PLIB_SPI_Disable.
25462  Parameters:
25463  index - Identifier for the device instance to be configured
25464  Returns:
25465  None.
25466  Example:
25467  <code>
25468  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
25469  // application developer.
25470  PLIB_SPI_AudioProtocolEnable(MY_SPI_INSTANCE);
25471  </code>
25472  Remarks:
25473  This function implements an operation of the audio protocol control feature.
25474  This feature may not be available on all devices. Please refer to the
25475  specific device data sheet to determine availability or use "PLIB_SPI_ExistsAudioProtocolControl"
25476  in your application to automatically determine whether this feature is available.
25477  */
25478 
25479 void
25481  SPI_MODULE_ID index ) ;
25482 //******************************************************************************
25483 /* Function:
25484  void PLIB_SPI_AudioProtocolDisable (SPI_MODULE_ID index)
25485  Summary:
25486  Audio protocol is disabled.
25487  Description:
25488  This function disables the audio protocol.
25489  This operation is atomic.
25490  Precondition:
25491  None.
25492  Parameters:
25493  index - Identifier for the device instance to be configured
25494  Returns:
25495  None.
25496  Example:
25497  <code>
25498  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
25499  // application developer.
25500  PLIB_SPI_AudioProtocolDisable(MY_SPI_INSTANCE);
25501  </code>
25502  Remarks:
25503  This function implements an operation of the audio protocol control feature.
25504  This feature may not be available on all devices. Please refer to the
25505  specific device data sheet to determine availability or use "PLIB_SPI_ExistsAudioProtocolControl"
25506  in your application to automatically determine whether this feature is available.
25507  */
25508 
25509 void
25511  SPI_MODULE_ID index ) ;
25512 //******************************************************************************
25513 /* Function:
25514  void PLIB_SPI_AudioTransmitModeSelect (SPI_MODULE_ID index,
25515  SPI_AUDIO_TRANSMIT_MODE mode)
25516  Summary:
25517  Selects the transmit audio data format.
25518  Description:
25519  This function selects the transmit audio data format.
25520  Precondition:
25521  None.
25522  Parameters:
25523  index - Identifier for the device instance to be configured
25524  mode - One of the SPI_TRANSMIT_AUDIO_MODE enumeration values as the
25525  transmit audio format
25526  Returns:
25527  None.
25528  Example:
25529  <code>
25530  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
25531  // application developer.
25532  PLIB_SPI_AudioTransmitModeSelect (MY_SPI_INSTANCE, SPI_AUDIO_TRANSMIT_MONO);
25533  </code>
25534  Remarks:
25535  This function implements an operation of the audio transmit mode feature.
25536  This feature may not be available on all devices. Please refer to the
25537  specific device data sheet to determine availability or use "PLIB_SPI_ExistsAudioTransmitMode"
25538  in your application to automatically determine whether this feature is available.
25539  */
25540 
25541 void
25543  SPI_MODULE_ID index ,
25544  SPI_AUDIO_TRANSMIT_MODE mode ) ;
25545 //******************************************************************************
25546 /* Function:
25547  void PLIB_SPI_AudioProtocolModeSelect(SPI_MODULE_ID index,
25548  SPI_AUDIO_PROTOCOL mode )
25549  Summary:
25550  Selects the Audio Protocol mode.
25551  Description:
25552  This function selects the Audio Protocol mode.
25553  Precondition:
25554  None.
25555  Parameters:
25556  index - Identifier for the device instance to be configured
25557  mode - One of the SPI_AUDIO_PROTOCOL enumeration values as the
25558  audio protocol
25559  Returns:
25560  None.
25561  Example:
25562  <code>
25563  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
25564  // application developer.
25565  PLIB_SPI_AudioProtocolModeSelect(MY_SPI_INSTANCE,SPI_AUDIO_PROTOCOL_RIGHT_JUSTIFIED );
25566  </code>
25567  Remarks:
25568  This function implements an operation of the audio protocol mode feature.
25569  This feature may not be available on all devices. Please refer to the
25570  specific device data sheet to determine availability or use "PLIB_SPI_ExistsAudioProtocolMode"
25571  in your application to automatically determine whether this feature is available.
25572  */
25573 
25574 void
25576  SPI_MODULE_ID index ,
25577  SPI_AUDIO_PROTOCOL mode ) ;
25578 // *****************************************************************************
25579 // *****************************************************************************
25580 // Section: SPI Peripheral Library Exists Functions
25581 // *****************************************************************************
25582 // *****************************************************************************
25583 /* The following functions indicate the existence of the features on the device.
25584 */
25585 //******************************************************************************
25586 /* Function:
25587  PLIB_SPI_ExistsEnableControl( SPI_MODULE_ID index )
25588  Summary:
25589  Identifies whether the EnableControl feature exists on the SPI module.
25590  Description:
25591  This function identifies whether the EnableControl feature is available on
25592  the SPI module.
25593  When this function returns true, these functions are supported on the device:
25594  - PLIB_SPI_Enable
25595  - PLIB_SPI_Disable
25596  This operation is atomic.
25597  Preconditions:
25598  None.
25599  Parameters:
25600  index - Identifier for the device instance
25601  Returns:
25602  - true - The EnableControl feature is supported on the device
25603  - false - The EnableControl feature is not supported on the device
25604  Remarks:
25605  None.
25606 */
25607 
25608 bool
25610  SPI_MODULE_ID index ) ;
25611 //******************************************************************************
25612 /* Function:
25613  PLIB_SPI_ExistsStopInIdleControl( SPI_MODULE_ID index )
25614  Summary:
25615  Identifies whether the StopInIdle feature exists on the SPI module.
25616  Description:
25617  This function identifies whether the StopInIdle feature is available on the
25618  SPI module.
25619  When this function returns true, these functions are supported on the device:
25620  - PLIB_SPI_StopInIdleEnable
25621  - PLIB_SPI_StopInIdleDisable
25622  This operation is atomic.
25623  Preconditions:
25624  None.
25625  Parameters:
25626  index - Identifier for the device instance
25627  Returns:
25628  - true - The StopInIdle feature is supported on the device
25629  - false - The StopInIdle feature is not supported on the device
25630  Remarks:
25631  None.
25632 */
25633 
25634 bool
25636  SPI_MODULE_ID index ) ;
25637 //******************************************************************************
25638 /* Function:
25639  PLIB_SPI_ExistsReceiverOverflow( SPI_MODULE_ID index )
25640  Summary:
25641  Identifies whether the ReceiverOverflow feature exists on the SPI module.
25642  Description:
25643  This function identifies whether the ReceiverOverflow feature is available
25644  on the SPI module.
25645  When this function returns true, these functions are supported on the device:
25646  - PLIB_SPI_ReceiverHasOverflowed
25647  - PLIB_SPI_ReceiverOverflowClear
25648  This operation is atomic.
25649  Preconditions:
25650  None.
25651  Parameters:
25652  index - Identifier for the device instance
25653  Returns:
25654  - true - The ReceiverOverflow feature is supported on the device
25655  - false - The ReceiverOverflow feature is not supported on the device
25656  Remarks:
25657  None.
25658 */
25659 
25660 bool
25662  SPI_MODULE_ID index ) ;
25663 //******************************************************************************
25664 /* Function:
25665  PLIB_SPI_ExistsTransmitBufferFullStatus( SPI_MODULE_ID index )
25666  Summary:
25667  Identifies whether the TransmitBufferFullStatus feature exists on the SPI module.
25668  Description:
25669  This function identifies whether the TransmitBufferFullStatus feature is available
25670  on the SPI module.
25671  When this function returns true, this function is supported on the device:
25672  - PLIB_SPI_TransmitBufferIsFull
25673  This operation is atomic.
25674  Preconditions:
25675  None.
25676  Parameters:
25677  index - Identifier for the device instance
25678  Returns:
25679  - true - The TransmitBufferFullStatus feature is supported on the device
25680  - false - The TransmitBufferFullStatus feature is not supported on the device
25681  Remarks:
25682  None.
25683 */
25684 
25685 bool
25687  SPI_MODULE_ID index ) ;
25688 //******************************************************************************
25689 /* Function:
25690  PLIB_SPI_ExistsTransmitBufferEmptyStatus( SPI_MODULE_ID index )
25691  Summary:
25692  Identifies whether the TransmitBufferEmptyStatus feature exists on the SPI module.
25693  Description:
25694  This function identifies whether the TransmitBufferEmptyStatus feature is available
25695  on the SPI module.
25696  When this function returns true, this function is supported on the device:
25697  - PLIB_SPI_TransmitBufferIsEmpty
25698  This operation is atomic.
25699  Preconditions:
25700  None.
25701  Parameters:
25702  index - Identifier for the device instance
25703  Returns:
25704  - true - The TransmitBufferEmptyStatus feature is supported on the device
25705  - false - The TransmitBufferEmptyStatus feature is not supported on the device
25706  Remarks:
25707  None.
25708 */
25709 
25710 bool
25712  SPI_MODULE_ID index ) ;
25713 //******************************************************************************
25714 /* Function:
25715  PLIB_SPI_ExistsReceiveBufferStatus( SPI_MODULE_ID index )
25716  Summary:
25717  Identifies whether the ReceiveBufferStatus feature exists on the SPI module.
25718  Description:
25719  This function identifies whether the ReceiveBufferStatus feature is available
25720  on the SPI module.
25721  When this function returns true, this function is supported on the device:
25722  - PLIB_SPI_ReceiverBufferIsFull
25723  This operation is atomic.
25724  Preconditions:
25725  None.
25726  Parameters:
25727  index - Identifier for the device instance
25728  Returns:
25729  - true - The ReceiveBufferStatus feature is supported on the device
25730  - false - The ReceiveBufferStatus feature is not supported on the device
25731  Remarks:
25732  None.
25733 */
25734 
25735 bool
25737  SPI_MODULE_ID index ) ;
25738 //******************************************************************************
25739 /* Function:
25740  PLIB_SPI_ExistsPinControl( SPI_MODULE_ID index )
25741  Summary:
25742  Identifies whether the PinControl feature exists on the SPI module.
25743  Description:
25744  This function identifies whether the PinControl feature is available on the
25745  SPI module.
25746  When this function returns true, these functions are supported on the device:
25747  - PLIB_SPI_PinEnable
25748  - PLIB_SPI_PinDisable
25749  This operation is atomic.
25750  Preconditions:
25751  None.
25752  Parameters:
25753  index - Identifier for the device instance
25754  Returns:
25755  - true - The PinControl feature is supported on the device
25756  - false - The PinControl feature is not supported on the device
25757  Remarks:
25758  None.
25759 */
25760 
25761 bool
25763  SPI_MODULE_ID index ) ;
25764 //******************************************************************************
25765 /* Function:
25766  PLIB_SPI_ExistsCommunicationWidth( SPI_MODULE_ID index )
25767  Summary:
25768  Identifies whether the CommunicationWidth feature exists on the SPI module.
25769  Description:
25770  This function identifies whether the CommunicationWidth feature is available
25771  on the SPI module.
25772  When this function returns true, this function is supported on the device:
25773  - PLIB_SPI_CommunicationWidthSelect
25774  This operation is atomic.
25775  Preconditions:
25776  None.
25777  Parameters:
25778  index - Identifier for the device instance
25779  Returns:
25780  - true - The CommunicationWidth feature is supported on the device
25781  - false - The CommunicationWidth feature is not supported on the device
25782  Remarks:
25783  None.
25784 */
25785 
25786 bool
25788  SPI_MODULE_ID index ) ;
25789 //******************************************************************************
25790 /* Function:
25791  PLIB_SPI_ExistsAudioCommunicationWidth( SPI_MODULE_ID index )
25792  Summary:
25793  Identifies whether the AudioCommunicationWidth feature exists on the SPI module.
25794  Description:
25795  This function identifies whether the AudioCommunicationWidth feature is available
25796  on the SPI module.
25797  When this function returns true, this function is supported on the device:
25798  - PLIB_SPI_AudioCommunicationWidthSelect
25799  This operation is atomic.
25800  Preconditions:
25801  None.
25802  Parameters:
25803  index - Identifier for the device instance
25804  Returns:
25805  - true - The AudioCommunicationWidth feature is supported on the device
25806  - false - The AudioCommunicationWidth feature is not supported on the device
25807  Remarks:
25808  None.
25809 */
25810 
25811 bool
25813  SPI_MODULE_ID index ) ;
25814 //******************************************************************************
25815 /* Function:
25816  PLIB_SPI_ExistsInputSamplePhase( SPI_MODULE_ID index )
25817  Summary:
25818  Identifies whether the InputSamplePhase feature exists on the SPI module.
25819  Description:
25820  This function identifies whether the InputSamplePhase feature is available
25821  on the SPI module.
25822  When this function returns true, this function is supported on the device:
25823  - PLIB_SPI_InputSamplePhaseSelect
25824  This operation is atomic.
25825  Preconditions:
25826  None.
25827  Parameters:
25828  index - Identifier for the device instance
25829  Returns:
25830  - true - The InputSamplePhase feature is supported on the device
25831  - false - The InputSamplePhase feature is not supported on the device
25832  Remarks:
25833  None.
25834 */
25835 
25836 bool
25838  SPI_MODULE_ID index ) ;
25839 //******************************************************************************
25840 /* Function:
25841  PLIB_SPI_ExistsOutputDataPhase( SPI_MODULE_ID index )
25842  Summary:
25843  Identifies whether the OutputDataPhase feature exists on the SPI module.
25844  Description:
25845  This function identifies whether the OutputDataPhase feature is available on
25846  the SPI module.
25847  When this function returns true, this function is supported on the device:
25848  - PLIB_SPI_OutputDataPhaseSelect
25849  This operation is atomic.
25850  Preconditions:
25851  None.
25852  Parameters:
25853  index - Identifier for the device instance
25854  Returns:
25855  - true - The OutputDataPhase feature is supported on the device
25856  - false - The OutputDataPhase feature is not supported on the device
25857  Remarks:
25858  None.
25859 */
25860 
25861 bool
25863  SPI_MODULE_ID index ) ;
25864 //******************************************************************************
25865 /* Function:
25866  PLIB_SPI_ExistsClockPolarity( SPI_MODULE_ID index )
25867  Summary:
25868  Identifies whether the ClockPolarity feature exists on the SPI module.
25869  Description:
25870  This function identifies whether the ClockPolarity feature is available on
25871  the SPI module.
25872  When this function returns true, this function is supported on the device:
25873  - PLIB_SPI_ClockPolaritySelect
25874  This operation is atomic.
25875  Preconditions:
25876  None.
25877  Parameters:
25878  index - Identifier for the device instance
25879  Returns:
25880  - true - The ClockPolarity feature is supported on the device
25881  - false - The ClockPolarity feature is not supported on the device
25882  Remarks:
25883  None.
25884 */
25885 
25886 bool
25888  SPI_MODULE_ID index ) ;
25889 //******************************************************************************
25890 /* Function:
25891  PLIB_SPI_ExistsMasterControl( SPI_MODULE_ID index )
25892  Summary:
25893  Identifies whether the MasterControl feature exists on the SPI module.
25894  Description:
25895  This function identifies whether the MasterControl feature is available on
25896  the SPI module.
25897  When this function returns true, these functions are supported on the device:
25898  - PLIB_SPI_MasterEnable
25899  - PLIB_SPI_SlaveEnable
25900  This operation is atomic.
25901  Preconditions:
25902  None.
25903  Parameters:
25904  index - Identifier for the device instance
25905  Returns:
25906  - true - The MasterControl feature is supported on the device
25907  - false - The MasterControl feature is not supported on the device
25908  Remarks:
25909  None.
25910 */
25911 
25912 bool
25914  SPI_MODULE_ID index ) ;
25915 //******************************************************************************
25916 /* Function:
25917  PLIB_SPI_ExistsBaudRate( SPI_MODULE_ID index )
25918  Summary:
25919  Identifies whether the BaudRate feature exists on the SPI module.
25920  Description:
25921  This function identifies whether the BaudRate feature is available on the SPI
25922  module.
25923  When this function returns true, this function is supported on the device:
25924  - PLIB_SPI_BaudRateSet
25925  This operation is atomic.
25926  Preconditions:
25927  None.
25928  Parameters:
25929  index - Identifier for the device instance
25930  Returns:
25931  - true - The BaudRate feature is supported on the device
25932  - false - The BaudRate feature is not supported on the device
25933  Remarks:
25934  None.
25935 */
25936 
25937 bool
25939  SPI_MODULE_ID index ) ;
25940 //******************************************************************************
25941 /* Function:
25942  PLIB_SPI_ExistsBusStatus( SPI_MODULE_ID index )
25943  Summary:
25944  Identifies whether the BusStatus feature exists on the SPI module.
25945  Description:
25946  This function identifies whether the BusStatus feature is available on the
25947  SPI module.
25948  When this function returns true, this function is supported on the device:
25949  - PLIB_SPI_IsBusy
25950  This operation is atomic.
25951  Preconditions:
25952  None.
25953  Parameters:
25954  index - Identifier for the device instance
25955  Returns:
25956  - true - The BusStatus feature is supported on the device
25957  - false - The BusStatus feature is not supported on the device
25958  Remarks:
25959  None.
25960 */
25961 
25962 bool
25964  SPI_MODULE_ID index ) ;
25965 //******************************************************************************
25966 /* Function:
25967  PLIB_SPI_ExistsReadDataSignStatus( SPI_MODULE_ID index )
25968  Summary:
25969  Identifies whether the ReadDataSignStatus feature exists on the SPI module.
25970  Description:
25971  This function identifies whether the ReadDataSignStatus feature is available
25972  on the SPI module.
25973  When this function returns true, this function is supported on the device:
25974  - PLIB_SPI_ReadDataIsSignExtended
25975  This operation is atomic.
25976  Preconditions:
25977  None.
25978  Parameters:
25979  index - Identifier for the device instance
25980  Returns:
25981  - true - The ReadDataSignStatus feature is supported on the device
25982  - false - The ReadDataSignStatus feature is not supported on the device
25983  Remarks:
25984  None.
25985 */
25986 
25987 bool
25989  SPI_MODULE_ID index ) ;
25990 //******************************************************************************
25991 /* Function:
25992  PLIB_SPI_ExistsSlaveSelectControl( SPI_MODULE_ID index )
25993  Summary:
25994  Identifies whether the SlaveSelectControl feature exists on the SPI module.
25995  Description:
25996  This function identifies whether the SlaveSelectControl feature is available
25997  on the SPI module.
25998  When this function returns true, these functions are supported on the device:
25999  - PLIB_SPI_SlaveSelectEnable
26000  - PLIB_SPI_SlaveSelectDisable
26001  This operation is atomic.
26002  Preconditions:
26003  None.
26004  Parameters:
26005  index - Identifier for the device instance
26006  Returns:
26007  - true - The SlaveSelectControl feature is supported on the device
26008  - false - The SlaveSelectControl feature is not supported on the device
26009  Remarks:
26010  None.
26011 */
26012 
26013 bool
26015  SPI_MODULE_ID index ) ;
26016 //******************************************************************************
26017 /* Function:
26018  PLIB_SPI_ExistsTransmitUnderRunStatus( SPI_MODULE_ID index )
26019  Summary:
26020  Identifies whether the TransmitUnderRunStatus feature exists on the SPI module.
26021  Description:
26022  This function identifies whether the TransmitUnderRunStatus feature is available
26023  on the SPI module.
26024  When this function returns true, these functions are supported on the device:
26025  - PLIB_SPI_TransmitUnderRunStatusGet
26026  - PLIB_SPI_TransmitUnderRunStatusClear
26027  This operation is atomic.
26028  Preconditions:
26029  None.
26030  Parameters:
26031  index - Identifier for the device instance
26032  Returns:
26033  - true - The TransmitUnderRunStatus feature is supported on the device
26034  - false - The TransmitUnderRunStatus feature is not supported on the device
26035  Remarks:
26036  None.
26037 */
26038 
26039 bool
26041  SPI_MODULE_ID index ) ;
26042 //******************************************************************************
26043 /* Function:
26044  PLIB_SPI_ExistsFIFOControl( SPI_MODULE_ID index )
26045  Summary:
26046  Identifies whether the FIFOControl feature exists on the SPI module.
26047  Description:
26048  This function identifies whether the FIFOControl feature is available on the
26049  SPI module.
26050  When this function returns true, these functions are supported on the device:
26051  - PLIB_SPI_FIFOEnable
26052  - PLIB_SPI_FIFODisable
26053  This operation is atomic.
26054  Preconditions:
26055  None.
26056  Parameters:
26057  index - Identifier for the device instance
26058  Returns:
26059  - true - The FIFOControl feature is supported on the device
26060  - false - The FIFOControl feature is not supported on the device
26061  Remarks:
26062  None.
26063 */
26064 
26065 bool
26067  SPI_MODULE_ID index ) ;
26068 //******************************************************************************
26069 /* Function:
26070  PLIB_SPI_ExistsFIFOCount( SPI_MODULE_ID index )
26071  Summary:
26072  Identifies whether the FIFOCount feature exists on the SPI module.
26073  Description:
26074  This function identifies whether the FIFOCount feature is available on the SPI module.
26075  When this function returns true, this function is supported on the device:
26076  - PLIB_SPI_FIFOCountGet
26077  This operation is atomic.
26078  Preconditions:
26079  None.
26080  Parameters:
26081  index - Identifier for the device instance
26082  Returns:
26083  - true - The FIFOCount feature is supported on the device
26084  - false - The FIFOCount feature is not supported on the device
26085  Remarks:
26086  None.
26087 */
26088 
26089 bool
26091  SPI_MODULE_ID index ) ;
26092 //******************************************************************************
26093 /* Function:
26094  PLIB_SPI_ExistsReceiveFIFOStatus( SPI_MODULE_ID index )
26095  Summary:
26096  Identifies whether the ReceiveFIFOStatus feature exists on the SPI module.
26097  Description:
26098  This function identifies whether the ReceiveFIFOStatus feature is available
26099  on the SPI module.
26100  When this function returns true, this function is supported on the device:
26101  - PLIB_SPI_ReceiverFIFOIsEmpty
26102  This operation is atomic.
26103  Preconditions:
26104  None.
26105  Parameters:
26106  index - Identifier for the device instance
26107  Returns:
26108  - true - The ReceiveFIFOStatus feature is supported on the device
26109  - false - The ReceiveFIFOStatus feature is not supported on the device
26110  Remarks:
26111  None.
26112 */
26113 
26114 bool
26116  SPI_MODULE_ID index ) ;
26117 //******************************************************************************
26118 /* Function:
26119  PLIB_SPI_ExistsFIFOShiftRegisterEmptyStatus( SPI_MODULE_ID index )
26120  Summary:
26121  Identifies whether the FIFOShiftRegisterEmptyStatus feature exists on the SPI module.
26122  Description:
26123  This function identifies whether the FIFOShiftRegisterEmptyStatus feature is
26124  available on the SPI module.
26125  When this function returns true, this function is supported on the device:
26126  - PLIB_SPI_FIFOShiftRegisterIsEmpty
26127  This operation is atomic.
26128  Preconditions:
26129  None.
26130  Parameters:
26131  index - Identifier for the device instance
26132  Returns:
26133  - true - The FIFOShiftRegisterEmptyStatus feature is supported on the device
26134  - false - The FIFOShiftRegisterEmptyStatus feature is not supported on the device
26135  Remarks:
26136  None.
26137 */
26138 
26139 bool
26141  SPI_MODULE_ID index ) ;
26142 //******************************************************************************
26143 /* Function:
26144  PLIB_SPI_ExistsFIFOInterruptMode( SPI_MODULE_ID index )
26145  Summary:
26146  Identifies whether the FIFOInterruptMode feature exists on the SPI module.
26147  Description:
26148  This function identifies whether the FIFOInterruptMode feature is available
26149  on the SPI module.
26150  When this function returns true, this function is supported on the device:
26151  - PLIB_SPI_FIFOInterruptModeSelect
26152  This operation is atomic.
26153  Preconditions:
26154  None.
26155  Parameters:
26156  index - Identifier for the device instance
26157  Returns:
26158  - true - The FIFOInterruptMode feature is supported on the device
26159  - false - The FIFOInterruptMode feature is not supported on the device
26160  Remarks:
26161  None.
26162 */
26163 
26164 bool
26166  SPI_MODULE_ID index ) ;
26167 //******************************************************************************
26168 /* Function:
26169  PLIB_SPI_ExistsFramedCommunication( SPI_MODULE_ID index )
26170  Summary:
26171  Identifies whether the FramedCommunication feature exists on the SPI module.
26172  Description:
26173  This function identifies whether the FramedCommunication feature is available
26174  on the SPI module.
26175  When this function returns true, these functions are supported on the device:
26176  - PLIB_SPI_FramedCommunicationEnable
26177  - PLIB_SPI_FramedCommunicationDisable
26178  This operation is atomic.
26179  Preconditions:
26180  None.
26181  Parameters:
26182  index - Identifier for the device instance
26183  Returns:
26184  - true - The FramedCommunication feature is supported on the device
26185  - false - The FramedCommunication feature is not supported on the device
26186  Remarks:
26187  None.
26188 */
26189 
26190 bool
26192  SPI_MODULE_ID index ) ;
26193 //******************************************************************************
26194 /* Function:
26195  PLIB_SPI_ExistsFrameSyncPulseDirection( SPI_MODULE_ID index )
26196  Summary:
26197  Identifies whether the FrameSyncPulseDirection feature exists on the SPI module.
26198  Description:
26199  This function identifies whether the FrameSyncPulseDirection feature is available
26200  on the SPI module.
26201  When this function returns true, this function is supported on the device:
26202  - PLIB_SPI_FrameSyncPulseDirectionSelect
26203  This operation is atomic.
26204  Preconditions:
26205  None.
26206  Parameters:
26207  index - Identifier for the device instance
26208  Returns:
26209  - true - The FrameSyncPulseDirection feature is supported on the device
26210  - false - The FrameSyncPulseDirection feature is not supported on the device
26211  Remarks:
26212  None.
26213 */
26214 
26215 bool
26217  SPI_MODULE_ID index ) ;
26218 //******************************************************************************
26219 /* Function:
26220  PLIB_SPI_ExistsFrameSyncPulsePolarity( SPI_MODULE_ID index )
26221  Summary:
26222  Identifies whether the FrameSyncPulsePolarity feature exists on the SPI module.
26223  Description:
26224  This function identifies whether the FrameSyncPulsePolarity feature is available
26225  on the SPI module.
26226  When this function returns true, this function is supported on the device:
26227  - PLIB_SPI_FrameSyncPulsePolaritySelect
26228  This operation is atomic.
26229  Preconditions:
26230  None.
26231  Parameters:
26232  index - Identifier for the device instance
26233  Returns:
26234  - true - The FrameSyncPulsePolarity feature is supported on the device
26235  - false - The FrameSyncPulsePolarity feature is not supported on the device
26236  Remarks:
26237  None.
26238 */
26239 
26240 bool
26242  SPI_MODULE_ID index ) ;
26243 //******************************************************************************
26244 /* Function:
26245  PLIB_SPI_ExistsFrameSyncPulseEdge( SPI_MODULE_ID index )
26246  Summary:
26247  Identifies whether the FrameSyncPulseEdge feature exists on the SPI module.
26248  Description:
26249  This function identifies whether the FrameSyncPulseEdge feature is available
26250  on the SPI module.
26251  When this function returns true, this function is supported on the device:
26252  - PLIB_SPI_FrameSyncPulseEdgeSelect
26253  This operation is atomic.
26254  Preconditions:
26255  None.
26256  Parameters:
26257  index - Identifier for the device instance
26258  Returns:
26259  - true - The FrameSyncPulseEdge feature is supported on the device
26260  - false - The FrameSyncPulseEdge feature is not supported on the device
26261  Remarks:
26262  None.
26263 */
26264 
26265 bool
26267  SPI_MODULE_ID index ) ;
26268 //******************************************************************************
26269 /* Function:
26270  PLIB_SPI_ExistsFrameSyncPulseWidth( SPI_MODULE_ID index )
26271  Summary:
26272  Identifies whether the FrameSyncPulseWidth feature exists on the SPI module.
26273  Description:
26274  This function identifies whether the FrameSyncPulseWidth feature is available
26275  on the SPI module.
26276  When this function returns true, this function is supported on the device:
26277  - PLIB_SPI_FrameSyncPulseWidthSelect
26278  This operation is atomic.
26279  Preconditions:
26280  None.
26281  Parameters:
26282  index - Identifier for the device instance
26283  Returns:
26284  - true - The FrameSyncPulseWidth feature is supported on the device
26285  - false - The FrameSyncPulseWidth feature is not supported on the device
26286  Remarks:
26287  None.
26288 */
26289 
26290 bool
26292  SPI_MODULE_ID index ) ;
26293 //******************************************************************************
26294 /* Function:
26295  PLIB_SPI_ExistsFrameSyncPulseCounter( SPI_MODULE_ID index )
26296  Summary:
26297  Identifies whether the FrameSyncPulseCounter feature exists on the SPI module.
26298  Description:
26299  This function identifies whether the FrameSyncPulseCounter feature is available
26300  on the SPI module.
26301  When this function returns true, this function is supported on the device:
26302  - PLIB_SPI_FrameSyncPulseCounterSelect
26303  This operation is atomic.
26304  Preconditions:
26305  None.
26306  Parameters:
26307  index - Identifier for the device instance
26308  Returns:
26309  - true - The FrameSyncPulseCounter feature is supported on the device
26310  - false - The FrameSyncPulseCounter feature is not supported on the device
26311  Remarks:
26312  None.
26313 */
26314 
26315 bool
26317  SPI_MODULE_ID index ) ;
26318 //******************************************************************************
26319 /* Function:
26320  PLIB_SPI_ExistsFrameErrorStatus( SPI_MODULE_ID index )
26321  Summary:
26322  Identifies whether the FrameErrorStatus feature exists on the SPI module.
26323  Description:
26324  This function identifies whether the FrameErrorStatus feature is available on
26325  the SPI module.
26326  When this function returns true, these functions are supported on the device:
26327  - PLIB_SPI_FrameErrorStatusGet
26328  - PLIB_SPI_FrameErrorStatusClear
26329  This operation is atomic.
26330  Preconditions:
26331  None.
26332  Parameters:
26333  index - Identifier for the device instance
26334  Returns:
26335  - true - The FrameErrorStatus feature is supported on the device
26336  - false - The FrameErrorStatus feature is not supported on the device
26337  Remarks:
26338  None.
26339 */
26340 
26341 bool
26343  SPI_MODULE_ID index ) ;
26344 //******************************************************************************
26345 /* Function:
26346  PLIB_SPI_ExistsBuffer( SPI_MODULE_ID index )
26347  Summary:
26348  Identifies whether the Buffer feature exists on the SPI module.
26349  Description:
26350  This function identifies whether the Buffer feature is available on the SPI module.
26351  When this function returns true, these functions are supported on the device:
26352  - PLIB_SPI_BufferClear
26353  - PLIB_SPI_BufferRead
26354  - PLIB_SPI_BufferWrite
26355  - PLIB_SPI_BufferAddressGet
26356  This operation is atomic.
26357  Preconditions:
26358  None.
26359  Parameters:
26360  index - Identifier for the device instance
26361  Returns:
26362  - true - The Buffer feature is supported on the device
26363  - false - The Buffer feature is not supported on the device
26364  Remarks:
26365  None.
26366 */
26367 
26368 bool
26370  SPI_MODULE_ID index ) ;
26371 //******************************************************************************
26372 /* Function:
26373  PLIB_SPI_ExistsBaudRateClock( SPI_MODULE_ID index )
26374  Summary:
26375  Identifies whether the BaudRateClock feature exists on the SPI module.
26376  Description:
26377  This function identifies whether the BaudRateClock feature is available on
26378  the SPI module.
26379  When this function returns true, this function is supported on the device:
26380  - PLIB_SPI_BaudRateClockSelect
26381  This operation is atomic.
26382  Preconditions:
26383  None.
26384  Parameters:
26385  index - Identifier for the device instance
26386  Returns:
26387  - true - The BaudRateClock feature is supported on the device
26388  - false - The BaudRateClock feature is not supported on the device
26389  Remarks:
26390  None.
26391 */
26392 
26393 bool
26395  SPI_MODULE_ID index ) ;
26396 //******************************************************************************
26397 /* Function:
26398  PLIB_SPI_ExistsErrorInterruptControl( SPI_MODULE_ID index )
26399  Summary:
26400  Identifies whether the ErrorInterruptControl feature exists on the SPI module.
26401  Description:
26402  This function identifies whether the ErrorInterruptControl feature is available
26403  on the SPI module.
26404  When this function returns true, these functions are supported on the device:
26405  - PLIB_SPI_ErrorInterruptEnable
26406  - PLIB_SPI_ErrorInterruptDisable
26407  This operation is atomic.
26408  Preconditions:
26409  None.
26410  Parameters:
26411  index - Identifier for the device instance
26412  Returns:
26413  - true - The ErrorInterruptControl feature is supported on the device
26414  - false - The ErrorInterruptControl feature is not supported on the device
26415  Remarks:
26416  None.
26417 */
26418 
26419 bool
26421  SPI_MODULE_ID index ) ;
26422 //******************************************************************************
26423 /* Function:
26424  PLIB_SPI_ExistsAudioErrorControl( SPI_MODULE_ID index )
26425  Summary:
26426  Identifies whether the AudioErrorControl feature exists on the SPI module.
26427  Description:
26428  This function identifies whether the AudioErrorControl feature is available
26429  on the SPI module.
26430  When this function returns true, these functions are supported on the device:
26431  - PLIB_SPI_AudioErrorEnable
26432  - PLIB_SPI_AudioErrorDisable
26433  This operation is atomic.
26434  Preconditions:
26435  None.
26436  Parameters:
26437  index - Identifier for the device instance
26438  Returns:
26439  - true - The AudioErrorControl feature is supported on the device
26440  - false - The AudioErrorControl feature is not supported on the device
26441  Remarks:
26442  None.
26443 */
26444 
26445 bool
26447  SPI_MODULE_ID index ) ;
26448 //******************************************************************************
26449 /* Function:
26450  PLIB_SPI_ExistsAudioProtocolControl( SPI_MODULE_ID index )
26451  Summary:
26452  Identifies whether the AudioProtocolControl feature exists on the SPI module.
26453  Description:
26454  This function identifies whether the AudioProtocolControl feature is available
26455  on the SPI module.
26456  When this function returns true, this function is supported on the device:
26457  - PLIB_SPI_AudioProtocolEnable
26458  - PLIB_SPI_AudioProtocolDisable
26459  This operation is atomic.
26460  Preconditions:
26461  None.
26462  Parameters:
26463  index - Identifier for the device instance
26464  Returns:
26465  - true - The AudioProtocolControl feature is supported on the device
26466  - false - The AudioProtocolControl feature is not supported on the device
26467  Remarks:
26468  None.
26469 */
26470 
26471 bool
26473  SPI_MODULE_ID index ) ;
26474 //******************************************************************************
26475 /* Function:
26476  PLIB_SPI_ExistsAudioTransmitMode( SPI_MODULE_ID index )
26477  Summary:
26478  Identifies whether the AudioTransmitMode feature exists on the SPI module.
26479  Description:
26480  This function identifies whether the AudioTransmitMode feature is available
26481  on the SPI module.
26482  When this function returns true, this function is supported on the device:
26483  - PLIB_SPI_AudioTransmitModeSelect
26484  This operation is atomic.
26485  Preconditions:
26486  None.
26487  Parameters:
26488  index - Identifier for the device instance
26489  Returns:
26490  - true - The AudioTransmitMode feature is supported on the device
26491  - false - The AudioTransmitMode feature is not supported on the device
26492  Remarks:
26493  None.
26494 */
26495 
26496 bool
26498  SPI_MODULE_ID index ) ;
26499 //******************************************************************************
26500 /* Function:
26501  PLIB_SPI_ExistsAudioProtocolMode( SPI_MODULE_ID index )
26502  Summary:
26503  Identifies whether the AudioProtocolMode feature exists on the SPI module.
26504  Description:
26505  This function identifies whether the AudioProtocolMode feature is available
26506  on the SPI module.
26507  When this function returns true, this function is supported on the device:
26508  - PLIB_SPI_AudioProtocolModeSelect
26509  This operation is atomic.
26510  Preconditions:
26511  None.
26512  Parameters:
26513  index - Identifier for the device instance
26514  Returns:
26515  - true - The AudioProtocolMode feature is supported on the device
26516  - false - The AudioProtocolMode feature is not supported on the device
26517  Remarks:
26518  None.
26519 */
26520 
26521 bool
26523  SPI_MODULE_ID index ) ;
26524 //******************************************************************************
26525 /* Function:
26526  PLIB_SPI_Exists32bitBuffer( SPI_MODULE_ID index )
26527  Summary:
26528  Identifies whether the Buffer32bit feature exists on the SPI module.
26529  Description:
26530  This function identifies whether the Buffer32bit feature is available on the
26531  SPI module.
26532  When this function returns true, these functions are supported on the device:
26533  - PLIB_SPI_BufferRead32bit
26534  - PLIB_SPI_BufferWrite32bit
26535  This operation is atomic.
26536  Preconditions:
26537  None.
26538  Parameters:
26539  index - Identifier for the device instance
26540  Returns:
26541  - true - The Buffer32bit feature is supported on the device
26542  - false - The Buffer32bit feature is not supported on the device
26543  Remarks:
26544  None.
26545 */
26546 
26547 bool
26549  SPI_MODULE_ID index ) ;
26550 //******************************************************************************
26551 /* Function:
26552  PLIB_SPI_Exists16bitBuffer( SPI_MODULE_ID index )
26553  Summary:
26554  Identifies whether the Buffer16bit feature exists on the SPI module.
26555  Description:
26556  This function identifies whether the Buffer16bit feature is available on the
26557  SPI module.
26558  When this function returns true, these functions are supported on the device:
26559  - PLIB_SPI_BufferRead16bit
26560  - PLIB_SPI_BufferWrite16bit
26561  This operation is atomic.
26562  Preconditions:
26563  None.
26564  Parameters:
26565  index - Identifier for the device instance
26566  Returns:
26567  - true - The Buffer16bit feature is supported on the device
26568  - false - The Buffer16bit feature is not supported on the device
26569  Remarks:
26570  None.
26571 */
26572 
26573 bool
26575  SPI_MODULE_ID index ) ;
26576 //DOM-IGNORE-BEGIN
26577 //DOM-IGNORE-END
26578  // #ifndef _PLIB_SPI_H
26579 /*******************************************************************************
26580  End of File
26581  */
26582 
26583 #endif /*00 C:\microchip\harmony\v2_06\framework\peripheral\spi\plib_spi.h*/
26584 /* CLOSE_FILE Include File */
26585 
26586  // SPI PLIB Header
26587 #include "system/common/sys_common.h" // Common System Service Definitions
26588 #include "system/common/sys_module.h" // Module/Driver Definitions
26589 #include "system/int/sys_int.h" // System Interrupt Definitions
26590 #include "system/clk/sys_clk.h"
26591 #include "C:\microchip\harmony\v2_06\framework\system\ports\sys_ports.h"
26592  /* LDRA full path */
26593 // DOM-IGNORE-BEGIN
26594 // DOM-IGNORE-END
26595 // *****************************************************************************
26596 /* SPI Driver Buffer Handle
26597  Summary:
26598  Handle identifying a read or write buffer passed to the driver.
26599  Description:
26600  A buffer handle value is returned by a call to the DRV_SPI_BufferAddRead()/
26601  DRV_SPI_BufferAddWrite or DRV_SPI_BufferAddReadWrite() functions.
26602  This handle is associated with the buffer passed into the function and
26603  it allows the application to track the completion of the data from (or into)
26604  that buffer. The buffer handle value returned from the "buffer add" function
26605  is returned back to the client by the "callback" function registered with
26606  the driver.
26607  The buffer handle assigned to a client request expires when the client has
26608  been notified of the completion of the buffer transfer (after event handler
26609  function that notifies the client returns) or after the buffer has been
26610  retired by the driver if no event handler callback was set.
26611  Remarks:
26612  None.
26613 */
26614 
26615 typedef
26616 uintptr_t
26618 // *****************************************************************************
26619 /* SPI Driver Invalid Buffer Handle
26620  Summary:
26621  Definition of an invalid buffer handle.
26622  Description:
26623  This is the definition of an invalid buffer handle. An invalid buffer handle
26624  is returned by DRV_SPI_BufferAddRead() and DRV_SPI_BufferAddWrite()
26625  function if the buffer add request was not successful.
26626  Remarks:
26627  None.
26628 */
26629 #define DRV_SPI_BUFFER_HANDLE_INVALID ( ( DRV_SPI_BUFFER_HANDLE ) ( - 1 ) )
26630 // *****************************************************************************
26631 /* SPI Driver Module Index Numbers
26632  Summary:
26633  SPI driver index definitions.
26634  Description:
26635  These constants provide the SPI driver index definitions.
26636  Remarks:
26637  These constants should be used in place of hard-coded numeric literals.
26638  These values should be passed into the DRV_SPI_Initialize and
26639  DRV_SPI_Open functions to identify the driver instance in use.
26640 */
26641 #define DRV_SPI_INDEX_0 0
26642 #define DRV_SPI_INDEX_1 1
26643 #define DRV_SPI_INDEX_2 2
26644 #define DRV_SPI_INDEX_3 3
26645 #define DRV_SPI_INDEX_4 4
26646 #define DRV_SPI_INDEX_5 5
26647 // *****************************************************************************
26648 /* SPI Driver Module Index Count
26649  Summary:
26650  Number of valid SPI driver indices.
26651  Description:
26652  This constant identifies the number of valid SPI driver indices.
26653  Remarks:
26654  This constant should be used in place of hard-coded numeric literals.
26655  This value is derived from device-specific header files defined as part
26656  of the peripheral libraries.
26657 */
26658 #define DRV_SPI_INDEX_COUNT SPI_NUMBER_OF_MODULES
26659 // *****************************************************************************
26660 /* SPI Clock Mode Selection
26661  Summary:
26662  Identifies the various clock modes of the SPI module.
26663  Description:
26664  This enumeration identifies the various clock modes of the SPI module.
26665  Remarks:
26666  None.
26667 */
26668 
26669 typedef
26670  enum
26671  {
26672  /* SPI Clock Mode 0:
26673  - Idle State of the clock is Low
26674  - Serial Output Data (SDO) Changed on Rising Edge of the clock
26675  - Serial Input Data (SDI) Sampled on Falling Edge of the clock */
26677  /*DOM-IGNORE-BEGIN*/
26678  = 0 /*DOM-IGNORE-END*/
26679  ,
26680  /* SPI Clock Mode 1:
26681  - Idle State of the clock is Low
26682  - Serial Output Data (SDO) Changes on Falling Edge of the clock
26683  - Serial Input Data (SDI) Sampled on Rising Edge of the clock */
26685  /*DOM-IGNORE-BEGIN*/
26686  = 1 /*DOM-IGNORE-END*/
26687  ,
26688  /* SPI Clock Mode 2:
26689  - Idle State of the clock is High
26690  - Serial Output Data (SDO) Changes on Falling Edge of the clock
26691  - Serial Input Data (SDI) Sampled on Rising Edge of the clock */
26693  /*DOM-IGNORE-BEGIN*/
26694  = 2 /*DOM-IGNORE-END*/
26695  ,
26696  /* SPI Clock Mode 3:
26697  - Idle State of the clock is High
26698  - Serial Output Data (SDO) Changes on Rising Edge of the clock
26699  - Serial Input Data (SDI) Sampled on Falling Edge of the clock */
26701  /*DOM-IGNORE-BEGIN*/
26702  = 3 /*DOM-IGNORE-END*/
26703  } DRV_SPI_CLOCK_MODE ;
26704 // *****************************************************************************
26705 /* SPI Buffer Type Selection
26706  Summary:
26707  Identifies the various buffer types of the SPI module.
26708  Description:
26709  This enumeration identifies the various buffer types of the SPI module.
26710  Remarks:
26711  None.
26712 */
26713 
26714 typedef
26715  enum
26716  {
26717  /* SPI Buffer Type Standard */
26719  /*DOM-IGNORE-BEGIN*/
26720  = 0 /*DOM-IGNORE-END*/
26721  ,
26722  /* SPI Enhanced Buffer Type */
26724  /*DOM-IGNORE-BEGIN*/
26725  = 1 /*DOM-IGNORE-END*/
26727 // *****************************************************************************
26728 /* SPI Protocols Enumeration
26729  Summary:
26730  Identifies the various protocols of the SPI module.
26731  Description:
26732  This enumeration identifies the various protocols of the SPI module.
26733  Remarks:
26734  None.
26735 */
26736 
26737 typedef
26738  enum
26739  {
26740  /* SPI Protocol Type Standard */
26742  /*DOM-IGNORE-BEGIN*/
26743  = 0 /*DOM-IGNORE-END*/
26744  ,
26745  /* SPI Protocol Type Framed */
26747  /*DOM-IGNORE-BEGIN*/
26748  = 1 /*DOM-IGNORE-END*/
26749  ,
26750  /*SPI Protocol Type Audio*/
26752  /*DOM-IGNORE-BEGIN*/
26753  = 2 /*DOM-IGNORE-END*/
26755 // *****************************************************************************
26756 /* SPI Driver Buffer Events
26757  Summary
26758  Identifies the possible events that can result from a buffer add request.
26759  Description
26760  This enumeration identifies the possible events that can result from a
26761  buffer add request caused by the client calling either
26762  DRV_SPI_BufferAddRead2 or DRV_SPI_BufferAddWrite2 or similar functions.
26763  Remarks:
26764  One of these values is passed in the "event" parameter of the event
26765  handling callback function that the client registered during buffer add
26766  requests.
26767 */
26768 
26769 typedef
26770  enum
26771  {
26772  /* Buffer is pending to get processed */
26774  /* Buffer is being processed */
26776  /* All data from or to the buffer was transferred successfully. */
26778  /* There was an error while processing the buffer transfer request. */
26781 // *****************************************************************************
26782 /* SPI Usage Modes Enumeration
26783  Summary:
26784  Identifies the various usage modes of the SPI module.
26785  Description:
26786  This enumeration identifies the various usage modes of the SPI module.
26787  Remarks:
26788  None.
26789 */
26790 
26791 typedef
26792  enum
26793  {
26794  /* SPI Mode Master */
26796  /*DOM-IGNORE-BEGIN*/
26797  = 0 /*DOM-IGNORE-END*/
26798  ,
26799  /* SPI Mode Slave */
26801  /*DOM-IGNORE-BEGIN*/
26802  = 1 /*DOM-IGNORE-END*/
26803  } DRV_SPI_MODE ;
26804 // *****************************************************************************
26805 /* SPI Task Modes Enumeration
26806  Summary:
26807  Identifies the various modes of how the tasks function will be run.
26808  Description:
26809  This enumeration identifies the various tasks mode
26810  Remarks:
26811  None.
26812 */
26813 
26814 typedef
26815  enum
26816  {
26817  /* Task is configured to run in polled mode */
26819  /*DOM-IGNORE-BEGIN*/
26820  = 0 /*DOM-IGNORE-END*/
26821  ,
26822  /* Task is configured to run in interrupt mode */
26824  /*DOM-IGNORE-BEGIN*/
26825  = 1 /*DOM-IGNORE-END*/
26826  } DRV_SPI_TASK_MODE ;
26827 // *****************************************************************************
26828 /* SPI Driver Buffer Event Handler Function Pointer
26829  Summary:
26830  Pointer to a SPI Driver Buffer Event handler function
26831  Description:
26832  This data type defines the required function signature for the SPI driver
26833  buffer event handling callback function. A client must register a pointer
26834  to a buffer event handling function who's function signature (parameter
26835  and return value types) match the types specified by this function pointer
26836  in order to receive buffer related event calls back from the driver.
26837  The parameters and return values and return value are described here and
26838  a partial example implementation is provided.
26839  Parameters:
26840  event - Identifies the type of event
26841  bufferHandle - Handle identifying the buffer to which the vent relates
26842  context - Value identifying the context of the application that
26843  registered the event handling function.
26844  Returns:
26845  None.
26846  Example:
26847  <code>
26848  void APP_MyBufferEventHandler( DRV_SPI_BUFFER_EVENT event,
26849  DRV_SPI_BUFFER_HANDLE bufferHandle,
26850  uintptr_t context )
26851  {
26852  MY_APP_DATA_STRUCT pAppData = (MY_APP_DATA_STRUCT) context;
26853  switch(event)
26854  {
26855  case DRV_SPI_BUFFER_EVENT_COMPLETE:
26856  // Handle the completed buffer.
26857  break;
26858  case DRV_SPI_BUFFER_EVENT_ERROR:
26859  default:
26860  // Handle error.
26861  break;
26862  }
26863  }
26864  </code>
26865  Remarks:
26866  If the event is DRV_SPI_BUFFER_EVENT_COMPLETE, it means that the data was
26867  transferred successfully.
26868  If the event is DRV_SPI_BUFFER_EVENT_ERROR, it means that the data was
26869  not transferred successfully.
26870  The bufferHandle parameter contains the buffer handle of the buffer that
26871  failed.
26872  The context parameter contains the a handle to the client context,
26873  provided at the time the event handling function registration.
26874  This context handle value is passed back to the client as the "context"
26875  parameter. It can be any value necessary to identify the client context
26876  or instance (such as a pointer to the client's data) instance of the
26877  client that made the buffer add request.
26878  The event handler function executes in an interrupt context when the driver
26879  is configured for interrupt mode operation. It is recommended of the
26880  application to not perform process intensive operations with in this
26881  function.
26882 */
26883 
26884 typedef
26886 DRV_SPI_BUFFER_HANDLE bufferHandle ,
26887 void * context ) ;
26888 // *****************************************************************************
26889 /* SPI Driver Initialization Data
26890  Summary:
26891  Defines the data required to initialize or reinitialize the SPI driver
26892  Description:
26893  This data type defines the data required to initialize or reinitialize the
26894  SPI driver. If the driver is built statically, the members of this data
26895  structure are statically over-ridden by static override definitions in the
26896  system_config.h file.
26897  Remarks:
26898  None.
26899 */
26900 
26901 typedef
26902 struct _DRV_SPI_INIT
26903 {
26904  /* System module initialization */
26905  SYS_MODULE_INIT moduleInit ;
26906  /* Identifies peripheral (PLIB-level) ID */
26907  SPI_MODULE_ID spiId ;
26908  /* SPI Task Mode Type*/
26910  /* SPI Usage Mode Type */
26912  /* Allow SPI to run when CPU goes to idle mode*/
26913  bool allowIdleRun ;
26914  /* SPI Protocol Type */
26916  /* SPI Slave Mode SSx Pin Select */
26917  bool spiSlaveSSPin ;
26918  /* Framed mode Sync Pulse*/
26919  SPI_FRAME_SYNC_PULSE frameSyncPulse ;
26920  /* Framed Mode pulse polarity*/
26921  SPI_FRAME_PULSE_POLARITY framePulsePolarity ;
26922  /* Framed Mode Pulse Direction*/
26923  SPI_FRAME_PULSE_DIRECTION framePulseDirection ;
26924  /* Framed mode Pulse Edge*/
26925  SPI_FRAME_PULSE_EDGE framePulseEdge ;
26926  /* Framed Mode Pulse width */
26927  SPI_FRAME_PULSE_WIDTH framePulseWidth ;
26928  /* Audio mode transmit mode*/
26929  SPI_AUDIO_TRANSMIT_MODE audioTransmitMode ;
26930  /* Audio mode protocol mode*/
26931  SPI_AUDIO_PROTOCOL audioProtocolMode ;
26932  /* Communication Width */
26933  SPI_COMMUNICATION_WIDTH commWidth ;
26934  /* SPI clock source which generates required baud rate.
26935  It can be either PBCLK or Reference Clock */
26936  SPI_BAUD_RATE_CLOCK baudClockSource ;
26937  /* when Baud rate clock source is peripheral clock, then this element is
26938  used to define which peripheral bus clock is used for this particular
26939  SPI instance. */
26940  CLK_BUSES_PERIPHERAL spiClk ;
26941  /* Baud Rate Value */
26942  uint32_t baudRate ;
26943  /* SPI Buffer Type */
26945  /* SPI Clock mode */
26947  /* SPI Input Sample Phase Selection */
26948  SPI_INPUT_SAMPLING_PHASE inputSamplePhase ;
26949  /* Transmit/Receive or Transmit Interrupt Source for SPI module */
26950  INT_SOURCE txInterruptSource ;
26951  /* Receive Interrupt Source for SPI module */
26952  INT_SOURCE rxInterruptSource ;
26953  /* Error Interrupt Source for SPI module */
26954  INT_SOURCE errInterruptSource ;
26955  /* While using standard buffer and polled mode how many transfers to do
26956  before yielding to other tasks*/
26957  uint8_t numTrfsSmPolled ;
26958  /* Dummy byte value which will be used for dummy transmission */
26959  uint32_t dummyByteValue ;
26960  /* This is the buffer queue size. This is the maximum
26961  number of transfer requests that driver will queue. */
26962  uint8_t queueSize ;
26963  /* This controls the minimum number of jobs that the driver will be able
26964  to accept without running out of memory. The driver will reserve this
26965  number of jobs from the global SPI queue so that it will always be available*/
26966  uint8_t jobQueueReserveSize ;
26967  /* This callback is fired when an operation is about to start on the
26968  SPI bus. This allows the user to set any pins that need to be set.
26969  This callback may be called from an ISR so should not include OSAL
26970  calls. The context parameter is the same one passed into the
26971  BufferAddRead, BufferAddWrite, BufferAddWriteRead function.
26972  */
26974  /* This callback is fired when an operation has just completed on the
26975  SPI bus. This allows the user to set any pins that need to be set.
26976  This callback may be called from an ISR so should not include OSAL
26977  calls. The context parameter is the same one passed into the
26978  BufferAddRead, BufferAddWrite, BufferAddWriteRead function.
26979  */
26981 } DRV_SPI_INIT ;
26982 // *****************************************************************************
26983 /* SPI Driver Client Specific Configuration
26984  Summary:
26985  Defines the data that can be changed per client.
26986  Description:
26987  This data type defines the data can be configured per client. This data can
26988  be per client, and overrides the configuration data contained inside of
26989  DRV_SPI_INIT.
26990  Remarks:
26991  None.
26992 */
26993 
26994 typedef
26995 struct _DRV_SPI_CLIENT_DATA
26996 {
26997  /* Baud Rate Value */
26998  uint32_t baudRate ;
26999  /* This callback is fired when an operation is about to start on the
27000  SPI bus. This allows the user to set any pins that need to be set.
27001  This callback may be called from an ISR so should not include OSAL
27002  calls. The context parameter is the same one passed into the
27003  BufferAddRead, BufferAddWrite, BufferAddWriteRead function.
27004  */
27006  /* This callback is fired when an operation has just completed on the
27007  SPI bus. This allows the user to set any pins that need to be set.
27008  This callback may be called from an ISR so should not include OSAL
27009  calls. The context parameter is the same one passed into the
27010  BufferAddRead, BufferAddWrite, BufferAddWriteRead function.
27011  */
27014 //DOM-IGNORE-BEGIN
27015 //DOM-IGNORE-END
27016  // #ifndef _DRV_SPI_DEFINITIONS_H
27017 /*******************************************************************************
27018  End of File
27019 */
27020 
27021 #endif /*00 C:\microchip\harmony\v2_06\framework\driver\spi\drv_spi_definitions.h*/
27022 /* CLOSE_FILE Include File */
27023 
27024 // DOM-IGNORE-BEGIN
27025 // DOM-IGNORE-END
27026 // *****************************************************************************
27027 // *****************************************************************************
27028 // Section: Interface Routines - System Level
27029 // *****************************************************************************
27030 // *****************************************************************************
27031 // *****************************************************************************
27032 /* Function:
27033  SYS_MODULE_OBJ DRV_SPI_Initialize( const SYS_MODULE_INDEX index,
27034  const SYS_MODULE_INIT * const init )
27035  Summary:
27036  Initializes the SPI instance for the specified driver index.
27037  <p><b>Implementation:</b> Static/Dynamic</p>
27038  Description:
27039  This routine initializes the SPI driver instance for the specified driver
27040  index, making it ready for clients to open and use it. The initialization
27041  data is specified by the 'init' parameter. The initialization may fail if the
27042  number of driver objects allocated are insufficient or if the specified
27043  driver instance is already initialized. The driver instance index is
27044  independent of the SPI module ID. For example, driver instance 0 can be
27045  assigned to SPI2. If the driver is built statically, then some of the
27046  initialization parameters are overridden by configuration macros. Refer to
27047  the description of the DRV_SPI_INIT data structure for more details on
27048  which members on this data structure are overridden.
27049  Precondition:
27050  None.
27051  Parameters:
27052  index - Identifier for the instance to be initialized. Please note this
27053  is not the SPI id. The hardware SPI id is set in the initialization
27054  structure. This is the index of the driver index to use.
27055  init - Pointer to a data structure containing any data necessary to
27056  initialize the driver. If this pointer is NULL, the driver
27057  uses the static initialization override macros for each
27058  member of the initialization data structure.
27059  Returns:
27060  - If successful - returns a valid handle to a driver instance object
27061  - If unsuccessful - returns SYS_MODULE_OBJ_INVALID
27062  Example:
27063  <code>
27064  DRV_SPI_INIT init;
27065  SYS_MODULE_OBJ objectHandle;
27066  // Populate the SPI initialization structure
27067  init.spiId = SPI_ID_1,
27068  init.taskMode = DRV_SPI_TASK_MODE_ISR,
27069  init.spiMode = DRV_SPI_MODE_MASTER,
27070  init.allowIdleRun = false,
27071  init.spiProtocolType = DRV_SPI_PROTOCOL_TYPE_STANDARD,
27072  init.commWidth = SPI_COMMUNICATION_WIDTH_8BITS,
27073  init.baudClockSource = SPI_BAUD_RATE_PBCLK_CLOCK;
27074  init.spiClk = CLK_BUS_PERIPHERAL_2,
27075  init.baudRate = 10000000,
27076  init.bufferType = DRV_SPI_BUFFER_TYPE_ENHANCED,
27077  init.clockMode = DRV_SPI_CLOCK_MODE_IDLE_LOW_EDGE_FALL,
27078  init.inputSamplePhase = SPI_INPUT_SAMPLING_PHASE_IN_MIDDLE,
27079  init.txInterruptSource = INT_SOURCE_SPI_1_TRANSMIT,
27080  init.rxInterruptSource = INT_SOURCE_SPI_1_RECEIVE,
27081  init.errInterruptSource = INT_SOURCE_SPI_1_ERROR,
27082  init.dummyByteValue = 0xFF,
27083  init.queueSize = 10,
27084  init.jobQueueReserveSize = 1,
27085  objectHandle = DRV_SPI_Initialize(DRV_SPI_INDEX_1, (SYS_MODULE_INIT*)usartInitData);
27086  if (SYS_MODULE_OBJ_INVALID == objectHandle)
27087  {
27088  // Handle error
27089  }
27090  </code>
27091  Remarks:
27092  This routine must be called before any other SPI routine is called.
27093  This routine should only be called once during system initialization
27094  unless DRV_SPI_Deinitialize is called to deinitialize the driver
27095  instance. This routine will NEVER block for hardware access.
27096 */
27097 
27098 SYS_MODULE_OBJ
27100  const SYS_MODULE_INDEX index ,
27101  const SYS_MODULE_INIT * const init ) ;
27102 //*************************************************************************
27103 /* Function:
27104  void DRV_SPI_Deinitialize ( SYS_MODULE_OBJ object )
27105  Summary:
27106  Deinitializes the specified instance of the SPI driver module.
27107  <p><b>Implementation:</b> Static/Dynamic</p>
27108  Description:
27109  Deinitializes the specified instance of the SPI driver module,
27110  disabling its operation (and any hardware) and invalidates all of the
27111  internal data.
27112  Precondition:
27113  Function DRV_SPI_Initialize must have been called before calling this
27114  routine and a valid SYS_MODULE_OBJ must have been returned.
27115  Parameters:
27116  object - Driver object handle, returned from DRV_SPI_Initialize
27117  Returns:
27118  None.
27119  Example:
27120  <code>
27121  SYS_MODULE_OBJ object; // Returned from DRV_SPI_Initialize
27122  SYS_STATUS status;
27123  DRV_SPI_Deinitialize ( object );
27124  status = DRV_SPI_Status( object );
27125  if( SYS_MODULE_UNINITIALIZED == status )
27126  {
27127  // Check again later if you need to know
27128  // when the driver is deinitialized.
27129  }
27130  </code>
27131  Remarks:
27132  Once the Initialize operation has been called, the De-initialize
27133  operation must be called before the Initialize operation can be called
27134  again.
27135  This function will NEVER block waiting for hardware. If the operation
27136  requires time to allow the hardware to complete, this will be reported
27137  by the DRV_SPI_Status operation. The system has to use DRV_SPI_Status
27138  to find out when the module is in the ready state.
27139 */
27140 
27141 void
27143  SYS_MODULE_OBJ object ) ;
27144 //**************************************************************************
27145 /* Function:
27146  SYS_STATUS DRV_SPI_Status ( SYS_MODULE_OBJ object )
27147  Summary:
27148  Provides the current status of the SPI driver module.
27149  <p><b>Implementation:</b> Static/Dynamic</p>
27150  Description:
27151  This function provides the current status of the SPI driver module.
27152  Precondition:
27153  The DRV_SPI_Initialize function must have been called before calling
27154  this function.
27155  Parameters:
27156  object - Driver object handle, returned from DRV_SPI_Initialize
27157  Returns:
27158  - SYS_STATUS_READY - Indicates that the driver is busy with a previous
27159  system level operation and cannot start another
27160  Example:
27161  <code>
27162  SYS_MODULE_OBJ object; // Returned from DRV_SPI_Initialize
27163  SYS_STATUS status;
27164  status = DRV_SPI_Status( object );
27165  if( SYS_STATUS_READY != status )
27166  {
27167  // Handle error
27168  }
27169  </code>
27170  Remarks:
27171  Any value greater than SYS_STATUS_READY is also a normal running state
27172  in which the driver is ready to accept new operations.
27173  SYS_MODULE_UNINITIALIZED - Indicates that the driver has been
27174  deinitialized
27175  This value is less than SYS_STATUS_ERROR.
27176  This function can be used to determine when any of the driver's module
27177  level operations has completed.
27178  If the status operation returns SYS_STATUS_BUSY, the previous operation
27179  has not yet completed. Once the status operation returns
27180  SYS_STATUS_READY, any previous operations have completed.
27181  The value of SYS_STATUS_ERROR is negative (-1). Any value less than
27182  that is also an error state.
27183  This function will NEVER block waiting for hardware.
27184  If the Status operation returns an error value, the error may be
27185  cleared by calling the reinitialize operation. If that fails, the
27186  deinitialize operation will need to be called, followed by the
27187  initialize operation to return to normal operations.
27188 */
27189 
27190 SYS_STATUS
27191  DRV_SPI_Status (
27192  SYS_MODULE_OBJ object ) ;
27193 // *****************************************************************************
27194 /* Function:
27195  void DRV_SPI_Tasks ( SYS_MODULE_OBJ object );
27196  Summary:
27197  Maintains the driver's state machine and implements its ISR.
27198  <p><b>Implementation:</b> Static/Dynamic</p>
27199  Description:
27200  This routine is used to maintain the driver's internal state
27201  machine and implement its transmit ISR for interrupt-driven implementations.
27202  In polling mode, this function should be called from the SYS_Tasks()
27203  function. In interrupt mode, this function should be called in the transmit
27204  interrupt service routine of the USART that is associated with this USART
27205  driver hardware instance.
27206  Precondition:
27207  The DRV_SPI_Initialize routine must have been called for the specified
27208  SPI driver instance.
27209  Parameters:
27210  object - Object handle for the specified driver instance (returned from
27211  DRV_SPI_Initialize)
27212  Returns:
27213  None.
27214  Example:
27215  <code>
27216  SYS_MODULE_OBJ object; // Returned from DRV_SPI_Initialize
27217  while( true )
27218  {
27219  DRV_SPI_Tasks ( object );
27220  // Do other tasks
27221  }
27222  </code>
27223  Remarks:
27224  This function is normally not called directly by an application. It is
27225  called by the system's Tasks routine (SYS_Tasks) or by the appropriate raw
27226  ISR.
27227  This function may execute in an ISR context and will never block or access any
27228  resources that may cause it to block.
27229 */
27230 
27231 void
27232  DRV_SPI_Tasks (
27233  SYS_MODULE_OBJ object ) ;
27234 // *****************************************************************************
27235 // *****************************************************************************
27236 // Section: Interface Routines - Client Level
27237 // *****************************************************************************
27238 // *****************************************************************************
27239 //**************************************************************************
27240 /* Function:
27241  DRV_HANDLE DRV_SPI_Open ( const SYS_MODULE_INDEX drvIndex,
27242  const DRV_IO_INTENT ioIntent )
27243  Summary:
27244  Opens the specified SPI driver instance and returns a handle to it.
27245  <p><b>Implementation:</b> Static/Dynamic</p>
27246  Description:
27247  This routine opens the specified SPI driver instance and provides a
27248  handle that must be provided to all other client-level operations to
27249  identify the caller and the instance of the driver. The ioIntent
27250  parameter defines how the client interacts with this driver instance.
27251  If ioIntent is DRV_IO_INTENT_READ, the client will only be read from
27252  the driver. If ioIntent is DRV_IO_INTENT_WRITE, the client will only be
27253  able to write to the driver. If the ioIntent in
27254  DRV_IO_INTENT_READWRITE, the client will be able to do both, read and
27255  write.
27256  Specifying a DRV_IO_INTENT_EXCLUSIVE will cause the driver to provide
27257  exclusive access to this client. The driver cannot be opened by any
27258  other client.
27259  Precondition:
27260  The DRV_SPI_Initialize function must have been called before calling
27261  this function.
27262  Parameters:
27263  drvIndex - Index of the driver initialized with DRV_SPI_Initialize().
27264  Please note this is not the SPI ID.
27265  ioIntent - Zero or more of the values from the enumeration
27266  DRV_IO_INTENT ORed together to indicate the intended use of
27267  the driver
27268  Returns:
27269  If successful, the routine returns a valid open-instance handle (a
27270  number identifying both the caller and the module instance).
27271  If an error occurs, the return value is DRV_HANDLE_INVALID. An error
27272  can occur when the following is true:
27273  * if the number of client objects allocated via
27274  DRV_SPI_INSTANCES_NUMBER is insufficient
27275  * if the client is trying to open the driver but driver has been
27276  opened exclusively by another client
27277  * if the driver hardware instance being opened is not initialized or
27278  is invalid
27279  Example:
27280  <code>
27281  DRV_HANDLE handle;
27282  handle = DRV_SPI_Open( DRV_SPI_INDEX_0, DRV_IO_INTENT_EXCLUSIVE );
27283  if( DRV_HANDLE_INVALID == handle )
27284  {
27285  // Unable to open the driver
27286  }
27287  </code>
27288  Remarks:
27289  The handle returned is valid until the DRV_SPI_Close routine is
27290  called. This routine will NEVER block waiting for hardware. If the
27291  requested intent flags are not supported, the routine will return
27292  DRV_HANDLE_INVALID. This function is thread safe in a RTOS application.
27293  It should not be called in an ISR.
27294 */
27295 
27296 DRV_HANDLE
27297  DRV_SPI_Open (
27298  const SYS_MODULE_INDEX drvIndex ,
27299  const DRV_IO_INTENT ioIntent ) ;
27300 //**************************************************************************
27301 /* Function:
27302  int32_t DRV_SPI_ClientConfigure ( DRV_HANDLE handle,
27303  const DRV_SPI_CLIENT_DATA * cfgData )
27304  Summary:
27305  Configures a SPI client with specific data.
27306  <p><b>Implementation:</b> Static/Dynamic</p>
27307  Description:
27308  This routine takes a DRV_SPI_CLIENT_DATA structure and sets client specific options.
27309  Whenever a new SPI job is started these values will be used. Passing in NULL will
27310  reset the client back to configuration parameters passed to driver initialization.
27311  A zero in any of the structure elements will reset that specific configuration back
27312  to the driver default.
27313  Precondition:
27314  The DRV_SPI_Open function must have been called before calling
27315  this function.
27316  Parameters:
27317  handle - handle of the client returned by DRV_SPI_Open.
27318  cfgData - Client-specific configuration data.
27319  Returns:
27320  - If successful - the routing will return greater than or equal to zero
27321  - If an error occurs - the return value is negative
27322 */
27323 
27324 int32_t
27326  DRV_HANDLE handle ,
27327  const DRV_SPI_CLIENT_DATA * cfgData ) ;
27328 // *****************************************************************************
27329 /* Function:
27330  void DRV_SPI_Close ( DRV_HANDLE handle )
27331  Summary:
27332  Closes an opened instance of the SPI driver.
27333  <p><b>Implementation:</b> Static/Dynamic</p>
27334  Description:
27335  This function closes an opened instance of the SPI driver, invalidating the
27336  handle.
27337  Precondition:
27338  The DRV_SPI_Initialize routine must have been called for the specified
27339  SPI driver instance.
27340  DRV_SPI_Open must have been called to obtain a valid opened device handle.
27341  Parameters:
27342  handle - A valid open-instance handle, returned from the driver's
27343  open routine
27344  Returns:
27345  None.
27346  Example:
27347  <code>
27348  DRV_HANDLE handle; // Returned from DRV_SPI_Open
27349  DRV_SPI_Close ( handle );
27350  </code>
27351  Remarks:
27352  After calling this routine, the handle passed in "handle" must not be used
27353  with any of the remaining driver routines. A new handle must be obtained by
27354  calling DRV_SPI_Open before the caller may use the driver again. This
27355  function is thread safe in a RTOS application.
27356  Note:
27357  Usually there is no need for the driver client to verify that the Close
27358  operation has completed.
27359 */
27360 
27361 void
27362  DRV_SPI_Close (
27363  DRV_HANDLE handle ) ;
27364 // *****************************************************************************
27365 // *****************************************************************************
27366 // Section: Interface Routines - Client level Read & Write APIs
27367 // *****************************************************************************
27368 // *****************************************************************************
27369 /* These are non-blocking APIs. It doesn't wait until the operation gets
27370  finished. The actual operation will happen it the task routine. The status of
27371  this operation can be monitored using DRV_SPI_BufferStatus function. In
27372  polling mode, User must ensure that the code gets time to execute the task
27373  routine. */
27374 //*******************************************************************************
27375 /* Function:
27376  DRV_SPI_BUFFER_HANDLE DRV_SPI_BufferAddRead ( DRV_HANDLE handle, void *rxBuffer,
27377  size_t size, DRV_SPI_BUFFER_EVENT_HANDLER completeCB,
27378  void * context )
27379  Summary:
27380  Registers a buffer for a read operation. Actual transfer will happen in
27381  the Task function.
27382  <p><b>Implementation:</b> Static/Dynamic</p>
27383  Description:
27384  Registers a buffer for a read operation. Actual transfer will happen in
27385  the Task function. The status of this operation can be monitored using
27386  DRV_SPI_BufferStatus function. A optional callback can also be
27387  provided that will be called when the operation is complete.
27388  Precondition:
27389  The DRV_SPI_Initialize routine must have been called for the specified
27390  SPI driver instance.
27391  DRV_SPI_Open must have been called to obtain a valid opened device
27392  handle.
27393  DRV_IO_INTENT_READ or DRV_IO_INTENT_READWRITE must have been specified
27394  in the DRV_SPI_Open call.
27395  Parameters:
27396  handle - A valid open-instance handle, returned from the driver's
27397  open routine
27398  rxBuffer - The buffer to which the data should be written to.
27399  size - Number of bytes to be read from the SPI bus.
27400  completeCB - Pointer to a function to be called when this queued operation is complete.
27401  context - unused by the driver but this is passed to the callback when it is called.
27402  Returns:
27403  If the buffer add request is successful, a valid buffer handle is returned.
27404  If request is not queued up, DRV_SPI_BUFFER_HANDLE_INVALID is returned.
27405  Example:
27406  <code>
27407  DRV_HANDLE handle; // Returned from DRV_SPI_Open
27408  char myBuffer[MY_BUFFER_SIZE], state = 0;
27409  DRV_SPI_BUFFER_HANDLE bufferHandle;
27410  switch ( state )
27411  {
27412  case 0:
27413  bufferHandle = DRV_SPI_BufferAddRead( handle, myBuffer, 10, NULL, NULL );
27414  if(bufferHandle != DRV_SPI_BUFFER_HANDLE_INVALID )
27415  {
27416  state++;
27417  }
27418  break;
27419  case 1:
27420  if(DRV_SPI_BufferStatus(bufferHandle) == DRV_SPI_BUFFER_EVENT_COMPLETE)
27421  {
27422  state++;
27423  // All transmitter data has been sent successfully.
27424  }
27425  break;
27426  }
27427  </code>
27428  Remarks:
27429  This API will be deprecated soon, so avoid using it. Use "DRV_SPI_BufferAddRead2"
27430  instead of it.
27431  */
27432 
27435  DRV_HANDLE handle ,
27436  void * rxBuffer ,
27437  size_t size ,
27438  DRV_SPI_BUFFER_EVENT_HANDLER completeCB ,
27439  void * context ) ;
27440 //*******************************************************************************
27441 /* Function:
27442  DRV_SPI_BUFFER_HANDLE DRV_SPI_BufferAddWrite ( DRV_HANDLE handle, void *txBuffer,
27443  size_t size, DRV_SPI_BUFFER_EVENT_HANDLER completeCB,
27444  void * context )
27445  Summary:
27446  Registers a buffer for a write operation. Actual transfer will happen
27447  in the Task function.
27448  <p><b>Implementation:</b> Static/Dynamic</p>
27449  Description:
27450  Registers a buffer for a write operation. Actual transfer will happen
27451  in the Task function. The status of this operation can be monitored
27452  using DRV_SPI_BufferStatus function. A optional callback can also be
27453  provided that will be called when the operation is complete.
27454  Precondition:
27455  The DRV_SPI_Initialize routine must have been called for the specified
27456  SPI driver instance.
27457  DRV_SPI_Open must have been called to obtain a valid opened device
27458  handle.
27459  DRV_IO_INTENT_WRITE or DRV_IO_INTENT_READWRITE must have been specified
27460  in the DRV_SPI_Open call.
27461  Parameters:
27462  handle - A valid open-instance handle, returned from the driver's
27463  open routine
27464  txBuffer - The buffer which hold the data.
27465  size - Number of bytes to be written to the SPI bus.
27466  completeCB - Pointer to a function to be called when this queued operation is complete
27467  context - unused by the driver but this is passed to the callback when it is called
27468  Returns:
27469  If the buffer add request is successful, a valid buffer handle is returned.
27470  If request is not queued up, DRV_SPI_BUFFER_HANDLE_INVALID is returned.
27471  Example:
27472  <code>
27473  DRV_HANDLE handle; // Returned from DRV_SPI_Open
27474  char myBuffer[MY_BUFFER_SIZE], state = 0;
27475  DRV_SPI_BUFFER_HANDLE bufferHandle;
27476  switch ( state )
27477  {
27478  case 0:
27479  bufferHandle = DRV_SPI_BufferAddWrite( handle, myBuffer, 10, NULL, NULL );
27480  if(bufferHandle != DRV_SPI_BUFFER_HANDLE_INVALID )
27481  {
27482  state++;
27483  }
27484  break;
27485  case 1:
27486  if(DRV_SPI_BufferStatus(bufferHandle) == DRV_SPI_BUFFER_EVENT_COMPLETE)
27487  {
27488  state++;
27489  // All transmitter data has been sent successfully.
27490  }
27491  break;
27492  }
27493  </code>
27494  Remarks:
27495  This API will be deprecated soon, so avoid using it. Use "DRV_SPI_BufferAddWrite2"
27496  instead of it.
27497 */
27498 
27501  DRV_HANDLE handle ,
27502  void * txBuffer ,
27503  size_t size ,
27504  DRV_SPI_BUFFER_EVENT_HANDLER completeCB ,
27505  void * context ) ;
27506 //*******************************************************************************
27507 /* Function:
27508  DRV_SPI_BUFFER_HANDLE DRV_SPI_BufferAddWriteRead( DRV_HANDLE handle,
27509  void *txBuffer, void *rxBuffer, size_t size, )
27510  Summary:
27511  Registers a buffer for a read and write operation. Actual transfer will
27512  happen in the Task function.
27513  <p><b>Implementation:</b> Static/Dynamic</p>
27514  Description:
27515  Registers a buffer for a read and write operation. Actual transfer will
27516  happen in the Task function. The status of this operation can be
27517  monitored using DRV_SPI_BufferStatus function. A optional callback can also be
27518  provided that will be called when the operation is complete.
27519  Precondition:
27520  The DRV_SPI_Initialize routine must have been called for the specified
27521  SPI driver instance.
27522  DRV_SPI_Open must have been called to obtain a valid opened device
27523  handle.
27524  Parameters:
27525  handle - A valid open-instance handle, returned from the driver's
27526  open routine
27527  txBuffer - The buffer which hold the data.
27528  txSize - Number of bytes to be written to the SPI bus.
27529  rxBuffer - The buffer to which the data should be written to.
27530  rxSize - Number of bytes to be read from the SPI bus
27531  completeCB - Pointer to a function to be called when this queued operation is complete
27532  context - unused by the driver but this is passed to the callback when it is called
27533  Returns:
27534  If the buffer add request is successful, a valid buffer handle is returned.
27535  If request is not queued up, DRV_SPI_BUFFER_HANDLE_INVALID is returned.
27536  Example:
27537  <code>
27538  DRV_HANDLE handle; // Returned from DRV_SPI_Open
27539  char myReadBuffer[MY_BUFFER_SIZE], myWriteBuffer[MY_BUFFER_SIZE], state = 0;
27540  DRV_SPI_BUFFER_HANDLE bufferHandle;
27541  switch ( state )
27542  {
27543  case 0:
27544  bufferHandle = DRV_SPI_BufferAddWriteRead( handle, myWriteBuffer, 10, myReadBuffer, 10, NULL, NULL );
27545  if(bufferHandle != DRV_SPI_BUFFER_HANDLE_INVALID )
27546  {
27547  state++;
27548  }
27549  break;
27550  case 1:
27551  if(DRV_SPI_BufferStatus(bufferHandle) == DRV_SPI_BUFFER_EVENT_COMPLETE)
27552  {
27553  state++;
27554  // All transmitter data has been sent successfully.
27555  }
27556  break;
27557  }
27558  </code>
27559  Remarks:
27560  This API will be deprecated soon, so avoid using it. Use "DRV_SPI_BufferAddWriteRead2"
27561  instead of it.
27562 */
27563 
27566  DRV_HANDLE handle ,
27567  void * txBuffer ,
27568  size_t txSize ,
27569  void * rxBuffer ,
27570  size_t rxSize ,
27571  DRV_SPI_BUFFER_EVENT_HANDLER completeCB ,
27572  void * context ) ;
27573 //*******************************************************************************
27574 /* Function:
27575  DRV_SPI_BUFFER_HANDLE DRV_SPI_BufferAddRead2 ( DRV_HANDLE handle, void *rxBuffer,
27576  size_t size, DRV_SPI_BUFFER_EVENT_HANDLER completeCB,
27577  void * context, DRV_SPI_BUFFER_HANDLE * jobHandle )
27578  Summary:
27579  Registers a buffer for a read operation. Actual transfer will happen in
27580  the Task function.
27581  <p><b>Implementation:</b> Static/Dynamic</p>
27582  Description:
27583  Registers a buffer for a read operation. Actual transfer will happen in
27584  the Task function. The status of this operation can be monitored using
27585  DRV_SPI_BufferStatus function. A optional callback can also be
27586  provided that will be called when the operation is complete.
27587  Precondition:
27588  The DRV_SPI_Initialize routine must have been called for the specified
27589  SPI driver instance.
27590  DRV_SPI_Open must have been called to obtain a valid opened device
27591  handle.
27592  DRV_IO_INTENT_READ or DRV_IO_INTENT_READWRITE must have been specified
27593  in the DRV_SPI_Open call.
27594  Parameters:
27595  handle - A valid open-instance handle, returned from the driver's
27596  open routine
27597  rxBuffer - The buffer to which the data should be written to.
27598  size - Number of bytes to be read from the SPI bus.
27599  completeCB - Pointer to a function to be called when this queued operation is complete
27600  context - unused by the driver but this is passed to the callback when it is called
27601  jobHandle - pointer to the buffer handle, this will be set before the function returns and can be used in the ISR callback.
27602  Returns:
27603  If the buffer add request is successful, a valid buffer handle is returned.
27604  If request is not queued up, DRV_SPI_BUFFER_HANDLE_INVALID is returned.
27605  Example:
27606  <code>
27607  DRV_HANDLE handle; // Returned from DRV_SPI_Open
27608  char myBuffer[MY_BUFFER_SIZE], state = 0;
27609  DRV_SPI_BUFFER_HANDLE bufferHandle, bufferHandle2;
27610  switch ( state )
27611  {
27612  case 0:
27613  bufferHandle = DRV_SPI_BufferAddRead2( handle, myBuffer, 10, NULL, NULL, &bufferHandle2 );
27614  if(bufferHandle2 != DRV_SPI_BUFFER_HANDLE_INVALID )
27615  {
27616  state++;
27617  }
27618  break;
27619  case 1:
27620  if(DRV_SPI_BufferStatus(bufferHandle2) == DRV_SPI_BUFFER_EVENT_COMPLETE)
27621  {
27622  state++;
27623  // All transmitter data has been sent successfully.
27624  }
27625  break;
27626  }
27627  </code>
27628  Remarks:
27629  None.
27630  */
27631 
27634  DRV_HANDLE handle ,
27635  void * rxBuffer ,
27636  size_t size ,
27637  DRV_SPI_BUFFER_EVENT_HANDLER completeCB ,
27638  void * context ,
27639  DRV_SPI_BUFFER_HANDLE * jobHandle ) ;
27640 //*******************************************************************************
27641 /* Function:
27642  DRV_SPI_BUFFER_HANDLE DRV_SPI_BufferAddWrite2 ( DRV_HANDLE handle, void *txBuffer,
27643  size_t size, DRV_SPI_BUFFER_EVENT_HANDLER completeCB,
27644  void * context, DRV_SPI_BUFFER_HANDLE * jobHandle )
27645  Summary:
27646  Registers a buffer for a write operation. Actual transfer will happen
27647  in the Task function.
27648  <p><b>Implementation:</b> Static/Dynamic</p>
27649  Description:
27650  Registers a buffer for a write operation. Actual transfer will happen
27651  in the Task function. The status of this operation can be monitored
27652  using DRV_SPI_BufferStatus function. A optional callback can also be
27653  provided that will be called when the operation is complete.
27654  Precondition:
27655  The DRV_SPI_Initialize routine must have been called for the specified
27656  SPI driver instance.
27657  DRV_SPI_Open must have been called to obtain a valid opened device
27658  handle.
27659  DRV_IO_INTENT_WRITE or DRV_IO_INTENT_READWRITE must have been specified
27660  in the DRV_SPI_Open call.
27661  Parameters:
27662  handle - A valid open-instance handle, returned from the driver's
27663  open routine
27664  txBuffer - The buffer which hold the data.
27665  size - Number of bytes to be written to the SPI bus.
27666  completeCB - Pointer to a function to be called when this queued operation is complete
27667  context - unused by the driver but this is passed to the callback when it is called
27668  jobHandle - pointer to the buffer handle, this will be set before the function returns and can be used in the ISR callback.
27669  Returns:
27670  If the buffer add request is successful, a valid buffer handle is returned.
27671  If request is not queued up, DRV_SPI_BUFFER_HANDLE_INVALID is returned.
27672  Example:
27673  <code>
27674  DRV_HANDLE handle; // Returned from DRV_SPI_Open
27675  char myBuffer[MY_BUFFER_SIZE], state = 0;
27676  DRV_SPI_BUFFER_HANDLE bufferHandle, bufferHandle2;
27677  switch ( state )
27678  {
27679  case 0:
27680  bufferHandle = DRV_SPI_BufferAddWrite2( handle, myBuffer, 10, NULL, NULL, &bufferHandle2 );
27681  if(bufferHandle2 != DRV_SPI_BUFFER_HANDLE_INVALID )
27682  {
27683  state++;
27684  }
27685  break;
27686  case 1:
27687  if(DRV_SPI_BufferStatus(bufferHandle2) == DRV_SPI_BUFFER_EVENT_COMPLETE)
27688  {
27689  state++;
27690  // All transmitter data has been sent successfully.
27691  }
27692  break;
27693  }
27694  </code>
27695  Remarks:
27696  None.
27697 */
27698 
27701  DRV_HANDLE handle ,
27702  void * txBuffer ,
27703  size_t size ,
27704  DRV_SPI_BUFFER_EVENT_HANDLER completeCB ,
27705  void * context ,
27706  DRV_SPI_BUFFER_HANDLE * jobHandle ) ;
27707 //*******************************************************************************
27708 /* Function:
27709  DRV_SPI_BUFFER_HANDLE DRV_SPI_BufferAddWriteRead2( DRV_HANDLE handle,
27710  void *txBuffer, void *rxBuffer, size_t size,
27711  DRV_SPI_BUFFER_EVENT_HANDLER completeCB,
27712  void * context, DRV_SPI_BUFFER_HANDLE * jobHandle )
27713  Summary:
27714  Registers a buffer for a read and write operation. Actual transfer will
27715  happen in the Task function.
27716  <p><b>Implementation:</b> Static/Dynamic</p>
27717  Description:
27718  Registers a buffer for a read and write operation. Actual transfer will
27719  happen in the Task function. The status of this operation can be
27720  monitored using DRV_SPI_BufferStatus function. A optional callback can also be
27721  provided that will be called when the operation is complete.
27722  Precondition:
27723  The DRV_SPI_Initialize routine must have been called for the specified
27724  SPI driver instance.
27725  DRV_SPI_Open must have been called to obtain a valid opened device
27726  handle.
27727  Parameters:
27728  handle - A valid open-instance handle, returned from the driver's
27729  open routine
27730  txBuffer - The buffer which hold the data.
27731  txSize - Number of bytes to be written to the SPI bus.
27732  rxBuffer - The buffer to which the data should be written to.
27733  rxSize - Number of bytes to be read from the SPI bus
27734  completeCB - Pointer to a function to be called when this queued operation is complete
27735  context - unused by the driver but this is passed to the callback when it is called
27736  jobHandle - pointer to the buffer handle, this will be set before the function returns and can be used in the ISR callback.
27737  Returns:
27738  If the buffer add request is successful, a valid buffer handle is returned.
27739  If request is not queued up, DRV_SPI_BUFFER_HANDLE_INVALID is returned.
27740  Example:
27741  <code>
27742  DRV_HANDLE handle; // Returned from DRV_SPI_Open
27743  char myReadBuffer[MY_BUFFER_SIZE], myWriteBuffer[MY_BUFFER_SIZE], state = 0;
27744  DRV_SPI_BUFFER_HANDLE bufferHandle, bufferHandle2;
27745  switch ( state )
27746  {
27747  case 0:
27748  bufferHandle = DRV_SPI_BufferAddWriteRead2( handle, myWriteBuffer, 10, myReadBuffer, 10, NULL, NULL, &bufferHandle2 );
27749  if(bufferHandle2 != DRV_SPI_BUFFER_HANDLE_INVALID )
27750  {
27751  state++;
27752  }
27753  break;
27754  case 1:
27755  if(DRV_SPI_BufferStatus(bufferHandle2) == DRV_SPI_BUFFER_EVENT_COMPLETE)
27756  {
27757  state++;
27758  // All transmitter data has been sent successfully.
27759  }
27760  break;
27761  }
27762  </code>
27763  Remarks:
27764  None.
27765 */
27766 
27769  DRV_HANDLE handle ,
27770  void * txBuffer ,
27771  size_t txSize ,
27772  void * rxBuffer ,
27773  size_t rxSize ,
27774  DRV_SPI_BUFFER_EVENT_HANDLER completeCB ,
27775  void * context ,
27776  DRV_SPI_BUFFER_HANDLE * jobHandle ) ;
27777 // *****************************************************************************
27778 /* Function:
27779  DRV_SPI_BUFFER_EVENT DRV_SPI_BufferStatus ( DRV_SPI_BUFFER_HANDLE bufferHandle )
27780  Summary:
27781  Returns the transmitter and receiver transfer status.
27782  <p><b>Implementation:</b> Static/Dynamic</p>
27783  Description:
27784  This returns the transmitter and receiver transfer status.
27785  Precondition:
27786  The DRV_SPI_Initialize routine must have been called for the specified
27787  SPI driver instance.
27788  DRV_SPI_Open must have been called to obtain a valid opened device handle.
27789  DRV_SPI_BufferAdd<Transfer> must have been called to obtain
27790  the buffer handle associated with that transfer.
27791  Parameters:
27792  bufferHandle - A valid buffer handle, returned from the driver's
27793  data transfer routine
27794  Returns:
27795  A DRV_SPI_BUFFER_STATUS value describing the current status of the
27796  transfer.
27797  Example:
27798  <code>
27799  // Buffer handle returned from the data transfer function
27800  DRV_SPI_BUFFER_HANDLE bufferHandle;
27801  if(DRV_SPI_BufferStatus(bufferHandle) == DRV_SPI_BUFFER_EVENT_COMPLETE)
27802  {
27803  // All transmitter data has been sent.
27804  }
27805  </code>
27806  Remarks:
27807  The returned status may contain a value with more than one of the bits
27808  specified in the DRV_SPI_BUFFER_STATUS enumeration set. The caller
27809  should perform an AND with the bit of interest and verify if the
27810  result is non-zero (as shown in the example) to verify the desired status
27811  bit.
27812 */
27813 
27816  DRV_SPI_BUFFER_HANDLE bufferHandle ) ;
27817 // *****************************************************************************
27818 /* Function:
27819  bool DRV_SPIn_ReceiverBufferIsFull(void)
27820  Summary:
27821  Returns the receive buffer status. 'n' represents the instance of the
27822  SPI driver used.
27823  <p><b>Implementation:</b> Static</p>
27824  Description:
27825  This function returns the receive buffer status (full/empty).
27826  Precondition:
27827  None.
27828  Parameters:
27829  None.
27830  Returns:
27831  Receive Buffer Status
27832  - 1 - Full
27833  - 0 - Empty
27834  Example:
27835  <code>
27836  bool rxBufStat;
27837  // Using instance 1 of SPI driver, that is n = 1
27838  rxBufStat = DRV_SPI1_ReceiverBufferIsFull();
27839  if (rxBufStat)
27840  {
27841  ...
27842  }
27843  </code>
27844  Remarks:
27845  None.
27846 */
27847 
27848 bool
27850 // *****************************************************************************
27851 /* Function:
27852  bool DRV_SPIn_TransmitterBufferIsFull(void)
27853  Summary:
27854  Returns the transmit buffer status. 'n' represents the instance of the
27855  SPI driver used.
27856  <p><b>Implementation:</b> Static</p>
27857  Description:
27858  This function returns the transmit buffer status (full/empty).
27859  Precondition:
27860  None.
27861  Parameters:
27862  None.
27863  Returns:
27864  Transmit Buffer Status
27865  - 1 - Full
27866  - 0 - Empty
27867  Example:
27868  <code>
27869  bool txBufStat;
27870  // Using instance 1 of SPI driver, that is n = 1
27871  txBufStat = DRV_SPI1_TransmitterBufferIsFull();
27872  if (txBufStat)
27873  {
27874  ...
27875  }
27876  </code>
27877  Remarks:
27878  None.
27879 */
27880 
27881 bool
27883 //DOM-IGNORE-BEGIN
27884 //DOM-IGNORE-END
27885  // #ifndef _DRV_SPI_H
27886 /*******************************************************************************
27887  End of File
27888 */
27889 
27890 #endif /*00 C:\microchip\harmony\v2_06\framework\driver\spi\drv_spi.h*/
27891 /* CLOSE_FILE Include File */
27892 
27893 #include "driver/usb/usbhs/drv_usbhs.h"
27894 #include "usb/usb_device.h"
27895 /* OPEN FILE C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\app.h */
27896 /**************************************************************************************/
27897 /* LDRA_INSPECTED 110 S
27898 */
27914 /**************************************************************************************/
27915 #ifndef APP_H /* Guard against multiple inclusion.*/
27916 #define APP_H
27917 /**************************************************************************************/
27918 /* ************************************************************************************/
27919 /* Section: Included Files */
27920 /**************************************************************************************/
27921 /**************************************************************************************/
27922 #include <stdint.h>
27923 /**************************************************************************************/
27924 /**************************************************************************************/
27925 /* Section: Data Types */
27926 /**************************************************************************************/
27927 /**************************************************************************************/
27928 /**************************************************************************************/
27929 /* APP_DATA
27930  Summary:
27931  Holds APP_DATA used for the APP tasks.
27932  Description:
27933  Holds APP_DATA used for the APP tasks. The variables
27934  used are stored here.
27935  Remarks:
27936  None
27937  */
27938 
27939 typedef
27940  struct
27941  {
27942  uint8_t RevNumber ;
27943  } APP_DATA ;
27944 
27945 extern APP_DATA
27946  APP ;
27947 /**************************************************************************************/
27948 /**************************************************************************************/
27949 /* Section: Application Initialization and State Machine Functions */
27950 /**************************************************************************************/
27951 /**************************************************************************************/
27952 /*!*************************************************************************************
27953  Function:
27954  void APP_Initialize(void)
27955  Summary:
27956  Autonomous tool application initialization routine.
27957  Description:
27958  This function initializes the application. It places the
27959  application in its initial state and prepares it to run so that its
27960  APP_Tasks function can be called.
27961  Precondition:
27962  All other system initialization routines should be called before calling
27963  this routine (in "SYS_Initialize").
27964  Parameters:
27965  None.
27966  Returns:
27967  None.
27968  Example:
27969  APP_Initialize()
27970  Remarks:
27971  This routine must be called from the main function.
27972 */
27973 
27974 void
27975  APP_Initialize ( void ) ;
27976 /*!*************************************************************************************
27977  Function:
27978  void APP_Tasks(void)
27979  Summary:
27980  Application tasks function
27981  Description:
27982  This function is the main application's tasks function. It contains the various
27983  tasks that are maintained during the operation of the shooting panel.
27984  Precondition:
27985  The system ("SYS_Initialize") and application ("APP_Initialize") initialization
27986  should be called before calling this.
27987  Parameters:
27988  None.
27989  Returns:
27990  None.
27991  Example:
27992  APP_Tasks()
27993  Remarks:
27994  This routine must be called from the main() routine.
27995  */
27996 
27997 void
27998  APP_Tasks ( void ) ;
27999  /* APP_H */
28000 /***************************************************************************************
28001  End of File
28002  */
28003 
28004 #endif /*00 C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\app.h*/
28005 /* CLOSE_FILE Include File */
28006 
28007 // DOM-IGNORE-BEGIN
28008 // DOM-IGNORE-END
28009 // *****************************************************************************
28010 // *****************************************************************************
28011 // Section: Type Definitions
28012 // *****************************************************************************
28013 // *****************************************************************************
28014 // *****************************************************************************
28015 /* System Objects
28016  Summary:
28017  Structure holding the system's object handles
28018  Description:
28019  This structure contains the object handles for all objects in the
28020  MPLAB Harmony project's system configuration.
28021  Remarks:
28022  These handles are returned from the "Initialize" functions for each module
28023  and must be passed into the "Tasks" function for each module.
28024 */
28025 
28026 typedef
28027  struct
28028  {
28029  SYS_MODULE_OBJ sysTmr ;
28030  SYS_MODULE_OBJ drvTmr0 ;
28031  SYS_MODULE_OBJ drvTmr1 ;
28032  SYS_MODULE_OBJ drvTmr2 ;
28033  SYS_MODULE_OBJ drvTmr3 ;
28034  SYS_MODULE_OBJ drvTmr4 ;
28035  SYS_MODULE_OBJ drvUsart0 ;
28036  SYS_MODULE_OBJ drvPMP0 ;
28037  /*** SPI Object for Index 0 ***/
28038  SYS_MODULE_OBJ spiObjectIdx0 ;
28039  /*** SPI Object for Index 1 ***/
28040  SYS_MODULE_OBJ spiObjectIdx1 ;
28041  /*** SPI Object for Index 2 ***/
28042  SYS_MODULE_OBJ spiObjectIdx2 ;
28043  SYS_MODULE_OBJ drvUSBObject ;
28044  SYS_MODULE_OBJ usbDevObject0 ;
28045  } SYSTEM_OBJECTS ;
28046 // *****************************************************************************
28047 // *****************************************************************************
28048 // Section: extern declarations
28049 // *****************************************************************************
28050 // *****************************************************************************
28051 
28052 extern SYSTEM_OBJECTS
28053  sysObj ;
28054 //DOM-IGNORE-BEGIN
28055 //DOM-IGNORE-END
28056  /* _SYS_DEFINITIONS_H */
28057 /*******************************************************************************
28058  End of File
28059 */
28060 
28061 #endif /*00 C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\system_definitions.h*/
28062 /* CLOSE_FILE Include File */
28063 
28064 
28065 typedef
28066 float
28068 /**************************************************************************************/
28069 /**************************************************************************************/
28070 /* Section: Data Types */
28071 /**************************************************************************************/
28072 /**************************************************************************************/
28073 
28074 typedef
28075  enum
28076  {
28083  } WL_CPS_STATES ;
28084 
28085 typedef
28086  struct
28087  {
28088  WL_CPS_STATES state ;
28089  DRV_HANDLE spi_cont_pot ;
28090  DRV_SPI_BUFFER_HANDLE bufferHandle ;
28091  DRV_SPI_BUFFER_HANDLE bufferHandle2 ;
28092  int8_t v_adj [ 1 ] ;
28093  uint16_t voltage ;
28094  uint16_t voltage_limit ;
28095  uint16_t current ;
28096  uint16_t max_current ;
28097  uint8_t current_limit ;
28098  uint8_t upper_current_limit ;
28099  uint8_t over_current_count ;
28100  float32_t volt_constant ;
28101  float32_t current_constant ;
28102  bool new_voltage_flag ;
28103  bool new_current_flag ;
28104  bool spi_write_complete_flag ;
28105  bool spi_sent_flag ;
28106  uint8_t avg_count ;
28107  uint8_t avg_count_max ;
28108  uint16_t current_array [ 5 ] ;
28109  uint16_t avg_current ;
28110  uint8_t overvoltage_count ;
28111  } WL_CPS_DATA ;
28112 
28113 extern WL_CPS_DATA
28114  WL_CPS ;
28115 /**************************************************************************************/
28116 /**************************************************************************************/
28117 /* Section: Local Functions */
28118 /**************************************************************************************/
28119 /**************************************************************************************/
28120 /*!*************************************************************************************
28121  Function:
28122  static void Init_WL_CPS( void )
28123  Summary:
28124  This function initializes the wire-line communication power supply parameters.
28125  Description:
28126  This function initializes the wire-line communication power supply parameters.
28127  Initial limits, flags and constants are set here.
28128 
28129  Precondition:
28130  None.
28131  Parameters:
28132  None.
28133  Returns
28134  None.
28135 
28136  Remarks
28137  None.
28138 
28139  Example:
28140  Init_WL_CPS()
28141  */
28142 
28143 static void
28144  Init_WL_CPS ( void ) ;
28145 /*!*************************************************************************************
28146  Function:
28147  static void Read_WL_CPS_V_I( void )
28148  Summary:
28149  This task reads the voltage and current from the wire line communication power
28150  supply(WL_CPS). It also tracks the maximum current from the supply.
28151  Description:
28152  This task reads the voltage and current from the wire line communication power
28153  supply(WL_CPS). It also tracks the maximum current from the supply.
28154 
28155  Precondition:
28156  None.
28157  Parameters:
28158  None.
28159  Returns
28160  None.
28161 
28162  Remarks
28163  None.
28164 
28165  Example:
28166  Read_WL_CPS_V_I( )
28167  */
28168 
28169 static void
28170  Read_WL_CPS_V_I ( void ) ;
28171 /*!*************************************************************************************
28172  Function:
28173  static void Check_WL_CPS_Over_Current( void )
28174  Summary:
28175  This function checks if the WL_CPS current has exceeded the current limit.
28176  Description:
28177  This function checks if the WL_CPS current has exceeded the current limit. If
28178  the current has exceeded the limit for five readings, the supply is turned off.
28179 
28180  Precondition:
28181  None.
28182  Parameters:
28183  None.
28184  Returns
28185  None.
28186 
28187  Remarks
28188  None.
28189 
28190  Example:
28191  Check_WL_CPS_Over_Current( )
28192  */
28193 
28194 static void
28195  Check_WL_CPS_Over_Current ( void ) ;
28196 /*!*************************************************************************************
28197  Function:
28198  void Set_WL_CPS_CurrentLimit(uint8_t value)
28199  Summary:
28200  This function sets the WL_CPS current limit.
28201  Description:
28202  This function sets the WL_CPS current limit. It must be less than or equal to
28203  the upper current limit. This parameter is used in the over current check.
28204 
28205  Precondition:
28206  None.
28207  Parameters:
28208  uint8_t value - the current limit in mA.
28209  Returns
28210  None.
28211 
28212  Remarks
28213  None.
28214 
28215  Example:
28216  Set_WL_CPS_CurrentLimit(70)
28217  */
28218 
28219 void
28221  uint8_t value ) ;
28222 /*!*************************************************************************************
28223  Function:
28224  void Adjust_WL_CPS_Voltage(uint8_t target)
28225  Summary:
28226  This function adjusts the WL_CPS to the desired voltage.
28227  Description:
28228  This function adjusts the WL_CPS to the desired voltage. The value is checked
28229  to ensure it is within the adjustable limits of 15 to 64 VDC. That voltage is
28230  converted to a table value that contains the appropriate pot settings for a
28231  given voltage. The pot settings is then transmitted via SPI port to the
28232  WL_CPS control pot.
28233 
28234  Precondition:
28235  None.
28236  Parameters:
28237  uint8_t target - desired voltage between 15 and 64V.
28238  Returns
28239  None.
28240 
28241  Remarks
28242  None.
28243 
28244  Example:
28245  Adjust_WL_CPS_Voltage(30)
28246  */
28247 
28248 void
28250  uint8_t target ) ;
28251 /**************************************************************************************/
28252 /**************************************************************************************/
28253 /* State Machine Functions */
28254 /**************************************************************************************/
28255 /**************************************************************************************/
28256 /*!*************************************************************************************
28257  Function:
28258  *
28259  void WL_CPS_Tasks(void)
28260  Summary:
28261  WL_CPS_Tasks function
28262  Description:
28263  This routine is the WL_SPS_Tasks function. It defines the WL_SPS_Tasks state
28264  machine and core logic. This machine is used to monitor the wire-line communication
28265  power supply (WL_CPS) voltage and current and will set flags when those limits
28266  are exceeded.
28267  Precondition:
28268  The system ("SYS_Initialize") and application ("APP_Initialize")initialization
28269  should be called before calling this.
28270  Parameters:
28271  None.
28272  Returns:
28273  None.
28274  Remarks:
28275  This routine must be called from the APP_Tasks() routine.
28276  Example:
28277  WL_CPS_Tasks()
28278  */
28279 
28280 void
28281  WL_CPS_Tasks ( void ) ;
28282  /* WL_CPS_H */
28283 /***************************************************************************************
28284  End of File
28285  */
28286 
28287 #endif /*00 C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\wl_cps.h*/
28288 /* CLOSE_FILE Include File */
28289 
28290 /* OPEN FILE C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\wl_sps.h */
28291 /**************************************************************************************/
28307 /**************************************************************************************/
28308 #ifndef WL_SPS_H /* Guard against multiple inclusion */
28309 #define WL_SPS_H
28310 /**************************************************************************************/
28311 /**************************************************************************************/
28312 /* Section: Included Files */
28313 /**************************************************************************************/
28314 /**************************************************************************************/
28315 #include "../system_config.h"
28316 #include "../system_definitions.h"
28317 #include <stdbool.h>
28318 /**************************************************************************************/
28319 /**************************************************************************************/
28320 /* Section: Defines */
28321 /**************************************************************************************/
28322 /**************************************************************************************/
28323  /* A brief description of a section can be given directly below the section
28324  banner.
28325  */
28326 #define NEGATIVE_OFFSET 0x02U
28327 #define POS_HIGH_OFFSET 0x01U
28328 #define POS_LOW_OFFSET 0x03U
28329 #define DEFAULT_OFFSET 0x04U
28330 #define I_ARRAY_SIZE 50U
28331 
28332 typedef
28333 float
28334  float32_t ;
28335 /**************************************************************************************/
28336 /**************************************************************************************/
28337 /* Section: Data Types */
28338 /**************************************************************************************/
28339 /**************************************************************************************/
28340 /**************************************************************************************/
28341 /* WL_SPS_STATES
28342  Summary:
28343  WL_SPS_STATES enumeration
28344  Description:
28345  This enumeration defines the valid WL_SPS states. These states
28346  determine the behavior of the WL_SPS state machine at various times.
28347 */
28348 
28349 typedef
28350  enum
28351  {
28359  } WL_SPS_STATES ;
28360 /**************************************************************************************/
28361 /* WL_SPS_DATA
28362  Summary:
28363  Holds WL_SPS_DATA used for the WL_SPS tasks.
28364  Description:
28365  Holds WL_SPS_DATA used for the WL_SPS tasks. The state machine and variables
28366  used to control WL_SPS functions are stored here.
28367  Remarks:
28368  None
28369  */
28370 
28371 typedef
28372  struct
28373  {
28374  WL_SPS_STATES state ;
28375  DRV_HANDLE drvICHandle ;
28376  uint16_t voltage ;
28377  uint16_t voltage_limit ;
28378  uint16_t upper_voltage_limit ;
28379  uint16_t volt_count ;
28380  uint16_t current ;
28381  uint16_t max_current ;
28382  uint16_t current_limit ;
28383  uint16_t upper_current_limit ;
28384  uint8_t over_current_count ;
28385  uint8_t array_sum_count ;
28386  uint8_t array_count ;
28387  uint16_t offset ;
28388  int16_t i_array [ 50U ] ;
28389  int16_t i_sum ;
28390  bool new_current_values_flag ;
28391  bool new_voltage_values_flag ;
28392  bool overcurrent_flag ;
28393  bool overvoltage_flag ;
28394  uint16_t sensor_offset ;
28395  uint16_t sensor_constant ;
28396  bool sensor_offset_tick ;
28397  uint16_t v_array [ 50 ] ;
28398  uint16_t v_array_count ;
28399  uint32_t v_sum ;
28400  float32_t v_avg ;
28401  bool tick ;
28402  uint8_t no_count ;
28403  bool array_full ;
28404  uint8_t overvoltage_count ;
28405  } WL_SPS_DATA ;
28406 
28407 extern WL_SPS_DATA
28408  WL_SPS ;
28409 /**************************************************************************************/
28410 /**************************************************************************************/
28411 /* Section: Interface Functions */
28412 /**************************************************************************************/
28413 /**************************************************************************************/
28414 /*!*************************************************************************************
28415  Function:
28416  void SET_WL_SPS_IOffset( uint8_t mode )
28417  Summary:
28418  This function sets the wire-line current offset based on external settings.
28419  Description:
28420  This function sets the wire-line current offset based on external settings.
28421 
28422  Precondition:
28423  None.
28424  Parameters:
28425  None.
28426  Returns
28427  None.
28428 
28429  Remarks:
28430  None.
28431 
28432  Example:
28433  SET_WL_SPS_IOffset( uint8_t mode )
28434  */
28435 
28436 void
28438  uint8_t mode ) ;
28439 /*!*************************************************************************************
28440  Function:
28441  void Set_WL_SPS_CurrentLimit(uint16_t value)
28442  Summary:
28443  This function sets the current limit for the wire-line shooting power
28444  supply (WL_SPS).
28445  Description:
28446  This function sets the current limit for the wire-line shooting power
28447  supply (WL_SPS) and ensures it it not greater than the upper current limit.
28448  If the value programmed is greater than the upper current limit, then the the
28449  current limit is set to the upper current limit value.
28450  This is used in the WL_SPS over current check.
28451 
28452  Precondition:
28453  None.
28454  Parameters:
28455  None.
28456  Returns
28457  None.
28458 
28459  Remarks:
28460  None.
28461 
28462  Example:
28463  Set_WL_SPS_CurrentLimit(uint16_t value)
28464  */
28465 
28466 void
28468  uint16_t value ) ;
28469 /**************************************************************************************/
28470 /**************************************************************************************/
28471 /* State Machine Functions */
28472 /**************************************************************************************/
28473 /**************************************************************************************/
28474 /*!*************************************************************************************
28475  Function:
28476  *
28477  void WL_SPS_Tasks(void)
28478  Summary:
28479  WL_SPS_Tasks function
28480  Description:
28481  This routine is the WL_SPS_Tasks function. It defines the WL_SPS_Tasks state
28482  machine and core logic. This machine is used to monitor the wire-line shooting
28483  power supply (WL_SPS) voltage and current and will set flags when those limits
28484  are exceeded. Those flags are monitored by the HV_PS machine and will turn the
28485  supply off if either of those flags are set.
28486  Precondition:
28487  The system ("SYS_Initialize") and application ("APP_Initialize")initialization
28488  should be called before calling this.
28489  Parameters:
28490  None.
28491  Returns:
28492  None.
28493  Remarks:
28494  This routine must be called from the APP_Tasks() routine.
28495  Example:
28496  WL_SPS_Tasks()
28497  */
28498 
28499 void
28500  WL_SPS_Tasks ( void ) ;
28501  /* WL_SPS_H */
28502 /***************************************************************************************
28503  End of File
28504  */
28505 
28506 #endif /*00 C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\wl_sps.h*/
28507 /* CLOSE_FILE Include File */
28508 
28509 /* OPEN FILE C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\statusst.h */
28510 /**************************************************************************************/
28527 /**************************************************************************************/
28528 #ifndef STATUSST_H /* Guard against multiple inclusion */
28529 #define STATUSST_H
28530 /**************************************************************************************/
28531 /**************************************************************************************/
28532 /* Section: Included Files */
28533 /**************************************************************************************/
28534 /**************************************************************************************/
28535 #include <stdbool.h>
28536 #include <stdint.h>
28537 /*typedef unsigned char uchar8_t*/
28538 /**************************************************************************************/
28539 /**************************************************************************************/
28540 /* Section: Interface Functions */
28541 /**************************************************************************************/
28542 /**************************************************************************************/
28543 /*!*************************************************************************************
28544  Function:
28545  void Set_Status(uint8_t bitposn)
28546  Summary:
28547  This function sets the desired bit to a one in the PIB status register.
28548  Description:
28549  This function sets the desired bit to a one in the PIB status register. This is
28550  called by various functions to indicate a command result or switch setting.
28551 
28552  Precondition:
28553  None.
28554  Parameters:
28555  uint8_t bitposn - the desired bit position in the PIB status register.
28556  Returns
28557  None.
28558 
28559  Remarks:
28560  None.
28561 
28562  Example:
28563  Set_Status(6)
28564  */
28565 
28566 void
28567  Set_Status (
28568  uint8_t bitposn ) ;
28569 /*!*************************************************************************************
28570  Function:
28571  void Clear_Status(unsigned short bitposn)
28572  Summary:
28573  This function sets the desired bit to a zero in the PIB status register.
28574  Description:
28575  This function sets the desired bit to a zero in the PIB status register. This is
28576  called by various functions to indicate a command result or switch setting.
28577 
28578  Precondition:
28579  None.
28580  Parameters:
28581  uint8_t bitposn - the desired bit position in the PIB status register.
28582  Returns
28583  None.
28584 
28585  Remarks:
28586  None.
28587 
28588  Example:
28589  ClearStatus(7)
28590  */
28591 
28592 void
28593  Clear_Status (
28594  uint8_t bitposn ) ;
28595 /*!*************************************************************************************
28596  Function:
28597  void Prepare_Return_A(uint8_t byte, uint16_t data2, uint16_t data1 )
28598  Summary:
28599  Function to prepare the protocol A response.
28600  Description:
28601  Function to prepare the protocol A response. The return message is seven bytes.
28602  the first byte is the command that was sent. the next two bytes are the PIB status
28603  register. The next three bytes can contain two - 12 bit data fields. The data is
28604  then transferred to the TxFifo. The CRC for the return message is calculated
28605  and placed in the last byte.
28606 
28607  Precondition:
28608  None.
28609  Parameters:
28610  uint8_t byte - The command byte.
28611  uint16_t data2 - a 12 bit data field.
28612  uint16_t data1 - 1 12 bit data field.
28613  Returns
28614  None.
28615 
28616  Remarks:
28617  None.
28618 
28619  Example:
28620  Prepare_Return_A(CMD.COMMAND[ 0 ], 0, 0)
28621  */
28622 
28623 void
28625  uint8_t byte ,
28626  uint16_t data2 ,
28627  uint16_t data1 ) ;
28628 /*!*************************************************************************************
28629  Function:
28630  void Prepare_Return_B(uint8_t byt[] )
28631  Summary:
28632  Function to prepare the protocol B response.
28633  Description:
28634  Function to prepare the protocol B response. The return message is seven bytes.
28635  the first byte is the command that was sent. the next two bytes are the PIB status
28636  register. The next three bytes can contain a 12 bit Switch status register,
28637  a four bit StateID and an 8 bit Switch ID. The data is then transferred to the
28638  TxFifo. The CRC for the return message is calculated and placed in the last byte.
28639 
28640  Precondition:
28641  None.
28642  Parameters:
28643  uint8_t byt[] - Three received bytes from a PerfSwitch.
28644  Returns
28645  None.
28646 
28647  Remarks:
28648  None.
28649 
28650  Example:
28651  Prepare_Return_B( MAN.msg )
28652  */
28653 
28654 void
28656  uint8_t byt [] ) ;
28657  /* STATUSST_H */
28658 /***************************************************************************************
28659  End of File
28660  */
28661 
28662 #endif /*00 C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\statusst.h*/
28663 /* CLOSE_FILE Include File */
28664 
28665 /* OPEN FILE C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\commmodule.h */
28666 /**************************************************************************************/
28682 /**************************************************************************************/
28683 #ifndef COMMMODULE_H /* Guard against multiple inclusion.*/
28684 #define COMMMODULE_H
28685 /**************************************************************************************/
28686 /**************************************************************************************/
28687 /* Section: Included Files */
28688 /**************************************************************************************/
28689 /**************************************************************************************/
28690 #include "../system_definitions.h"
28691 /**************************************************************************************/
28692 /**************************************************************************************/
28693 /* Section: Data Types */
28694 /**************************************************************************************/
28695 /**************************************************************************************/
28696 /**************************************************************************************/
28697 /* COMM states
28698  Summary:
28699  COMM states enumeration
28700  Description:
28701  This enumeration defines the valid COMM states. These states
28702  determine the behavior of the COMM state machine at various times.
28703 */
28704 
28705 typedef
28706  enum
28707  {
28712  } COMM_STATES ;
28713 /**************************************************************************************/
28714 /* COMM Data
28715  Summary:
28716  Holds COMM data used for the COMM tasks.
28717  Description:
28718  Holds COMM data used for the COMM tasks. The state machine and variables used
28719  to control COMM message are stored here.
28720  Remarks:
28721  None
28722  */
28723 
28724 typedef
28725  struct /* This structure collects the variables and states required for these*/
28726  {
28727  /* functions to operate.*/
28728  COMM_STATES state ;
28729  DRV_HANDLE handleUSART0 ;
28730  uint8_t tx_count ;
28731  uint8_t rx_count ;
28732  bool processing ;
28733  } COMM_DATA ;
28734 
28735 extern COMM_DATA
28736  COMM ;
28737 /**************************************************************************************/
28738 /**************************************************************************************/
28739 /* Section: Local Functions */
28740 /**************************************************************************************/
28741 /**************************************************************************************/
28742 /*!*************************************************************************************
28743  Function:
28744  static void ValidateComm(void)
28745  Summary:
28746  This function reads the battery voltage, temperature and remaining capacity
28747  based on the command given to the function
28748  Description:
28749  Description: This task handles reading messages from Receive Queue (RxQ Fifo) and
28750  processes them. It looks for a valid command & upon finding it puts the remainder
28751  into the Command buffer for processing.
28752 
28753 
28754 
28755  Precondition:
28756  None.
28757  Parameters:
28758  None.
28759  Returns
28760  None.
28761 
28762  Remarks
28763  None.
28764 
28765  Example:
28766  void ValidateComm()
28767  */
28768 
28769 static void
28770  ValidateComm ( void ) ;
28771 /**************************************************************************************/
28772 /**************************************************************************************/
28773 /* State Machine Functions */
28774 /**************************************************************************************/
28775 /**************************************************************************************/
28776 /*!*************************************************************************************
28777  Function:
28778  void COMM_Tasks(void)
28779  Summary:
28780  COMM tasks function
28781  Description:
28782  This routine is the COMM tasks function. It defines the COMM's state machine and
28783  core logic. This task controls the communications between a host UART or host USB.
28784  Precondition:
28785  The system ("SYS_Initialize") and application ("APP_Initialize")initialization
28786  should be called before calling this.
28787  Parameters:
28788  None.
28789  Returns:
28790  None.
28791  Example:
28792  COMM_Tasks()
28793 
28794  Remarks:
28795  This routine must be called from COMM_Tasks() routine.
28796  */
28797 
28798 void
28799  COMM_Tasks ( void ) ;
28800  /* COMMMODULE_H */
28801 /***************************************************************************************
28802  End of File
28803  */
28804 
28805 #endif /*00 C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\commmodule.h*/
28806 /* CLOSE_FILE Include File */
28807 
28808 #include "app.h"
28809 /* OPEN FILE C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\fsk.h */
28810 /**************************************************************************************/
28824 /**************************************************************************************/
28825 #ifndef FSK_H /* Guard against multiple inclusion */
28826 #define FSK_H
28827 /**************************************************************************************/
28828 /**************************************************************************************/
28829 /* Section: Included Files */
28830 /**************************************************************************************/
28831 /**************************************************************************************/
28832 #include "../system_config.h"
28833 #include "../system_definitions.h"
28834 /**************************************************************************************/
28835 /**************************************************************************************/
28836 /* Section: Data Types */
28837 /**************************************************************************************/
28838 /**************************************************************************************/
28839 
28840 typedef
28841 float
28842  float32_t ;
28843 /**************************************************************************************/
28844 /*FSK states
28845  Summary:
28846  FSK states enumeration
28847  Description:
28848  This enumeration defines the valid FSK states. These states
28849  determine the behavior of the FSK state machine at various times.
28850 */
28851 
28852 typedef
28853  enum
28854  {
28861  } FSK_STATES ;
28862 /**************************************************************************************/
28863 /* FSK_DATA
28864  Summary:
28865  Holds FSK_DATA used for the FSK tasks.
28866  Description:
28867  Holds FSK_DATA used for the FSK tasks. The state machine and variables
28868  used to control FSK functions are stored here.
28869  Remarks:
28870  None
28871  */
28872 
28873 typedef
28874  struct
28875  {
28876  FSK_STATES state ;
28877  uint8_t crc ;
28878  uint8_t null_count ;
28879  bool send_message_complete_flag ;
28880  bool tick ;
28881  float32_t baud ;
28882  float32_t fsk_timer_freq ;
28883  float32_t mark_count ;
28884  float32_t space_count ;
28885  float32_t TABLE_MOD [ 50 ] ;
28886  uint8_t table_count ;
28887  } FSK_DATA ;
28888 
28889 extern FSK_DATA
28890  FSK ;
28891  /**************************************************************************************/
28892 
28893 typedef
28894  union /* Union defining the PerfSwitch message component lengths.*/
28895  {
28896  uint32_t dword ;
28897  uint16_t word ;
28898  uint8_t byte [ 4 ] ;
28899  } TMultiValue ;
28900 
28901 extern TMultiValue
28902  MESSAGE ;
28903 /**************************************************************************************/
28904 /**************************************************************************************/
28905 /* DOWN_MSG Data
28906  Summary:
28907  Holds DOWN_MSG data used for the FSK tasks.
28908  Description:
28909  Holds DOWN_MSG data used for the FSK tasks. The variables used to control FSK
28910  message are stored here.
28911  Remarks:
28912  None
28913  */
28914 
28915 typedef
28916  struct /* Structure defining the components of the FSK message to a PerfSwitch.*/
28917  {
28918  uint8_t identifier ;
28919  uint8_t command ;
28920  uint8_t msg_length ;
28921  uint8_t xmit_ready_flag ;
28922  } DOWN_MSG ;
28923 
28924 extern DOWN_MSG
28925  DWNMSG ;
28926 /**************************************************************************************/
28927 /*MSG states
28928  Summary:
28929  MSG states enumeration
28930  Description:
28931  This enumeration defines the valid MSG states. These states
28932  determine the behavior of the MSG state machine at various times. This machine
28933  also controls access to the PRE_MSG state machine.
28934 */
28935 
28936 typedef
28937  enum
28938  {
28944  } MSG_STATES ;
28945 /**************************************************************************************/
28946 /* MSG_DATA
28947  Summary:
28948  Holds MSG_DATA used for the MSG tasks.
28949  Description:
28950  Holds MSG_DATA used for the MSG tasks. The state machine and variables
28951  used to control MSG functions are stored here.
28952  Remarks:
28953  None
28954  */
28955 
28956 typedef
28957  struct
28958  {
28959  MSG_STATES state ;
28960  uint32_t command ;
28961  uint8_t length ;
28962  } MSG_DATA ;
28963 
28964 extern MSG_DATA
28965  MSG ;
28966 /**************************************************************************************/
28967 /*PREAMBLE states
28968  Summary:
28969  PRE_MSG states enumeration
28970  Description:
28971  This enumeration defines the valid PREAMBLE states. These states
28972  determine the behavior of the PREAMBLE state machine at various times. This is
28973  accessed from the MSG_STATE machine.
28974 */
28975 
28976 typedef
28977  enum
28978  {
28985  } PREAMBLE_STATES ;
28986 /**************************************************************************************/
28987 /* PRE_DATA
28988  Summary:
28989  Holds PRE_MSG_DATA used for the PRE_MSG tasks.
28990  Description:
28991  Holds PRE_MSG_DATA used for the PRE_MSG tasks. The state machine and variables
28992  used to control PRE_MSG functions are stored here.
28993  Remarks:
28994  None
28995  */
28996 
28997 typedef
28998  struct
28999  {
29000  PREAMBLE_STATES state ;
29001  } PRE_DATA ;
29002 
29003 extern PRE_DATA
29004  PRE_MSG ;
29005 
29006 static const uint8_t
29007  Xmit11 [ 312 ] = /* Array for the FSK frequency generation for a 'Mark'.*/
29008  { 0x7FU , 0x99U , 0xB1U , 0xC6U , 0xD6U , 0xE0U , 0xE3U , 0xE0U , 0xD6U , 0xC6U , 0xB1U , 0x99U , 0x80U , 0x66U , 0x4EU , 0x39U , 0x29U , 0x1FU , 0x1BU , 0x1EU , 0x28U , 0x38U , 0x4CU , 0x65U , 0x7FU , 0x99U , 0xB1U , 0xC6U , 0xD6U ,
29009  0xE0U , 0xE3U , 0xE0U , 0xD6U , 0xC6U , 0xB1U , 0x99U , 0x80U , 0x66U , 0x4EU , 0x39U , 0x29U , 0x1FU , 0x1BU , 0x1EU , 0x28U , 0x38U , 0x4CU , 0x65U , 0x7FU , 0x99U , 0xB1U , 0xC6U , 0xD6U , 0xE0U , 0xE3U , 0xE0U , 0xD6U , 0xC6U , 0xB1U
29010  , 0x99U , 0x80U , 0x66U , 0x4EU , 0x39U , 0x29U , 0x1FU , 0x1BU , 0x1EU , 0x28U , 0x38U , 0x4CU , 0x65U , 0x7FU , 0x99U , 0xB1U , 0xC6U , 0xD6U , 0xE0U , 0xE3U , 0xE0U , 0xD6U , 0xC6U , 0xB1U , 0x99U , 0x80U , 0x66U , 0x4EU , 0x39U ,
29011  0x29U , 0x1FU , 0x1BU , 0x1EU , 0x28U , 0x38U , 0x4CU , 0x65U , 0x7FU , 0x99U , 0xB1U , 0xC6U , 0xD6U , 0xE0U , 0xE3U , 0xE0U , 0xD6U , 0xC6U , 0xB1U , 0x99U , 0x80U , 0x66U , 0x4EU , 0x39U , 0x29U , 0x1FU , 0x1BU , 0x1EU , 0x28U , 0x38U
29012  , 0x4CU , 0x65U , 0x7FU , 0x99U , 0xB1U , 0xC6U , 0xD6U , 0xE0U , 0xE3U , 0xE0U , 0xD6U , 0xC6U , 0xB1U , 0x99U , 0x80U , 0x66U , 0x4EU , 0x39U , 0x29U , 0x1FU , 0x1BU , 0x1EU , 0x28U , 0x38U , 0x4CU , 0x65U , 0x7FU , 0x99U , 0xB1U ,
29013  0xC6U , 0xD6U , 0xE0U , 0xE3U , 0xE0U , 0xD6U , 0xC6U , 0xB1U , 0x99U , 0x80U , 0x66U , 0x4EU , 0x39U , 0x29U , 0x1FU , 0x1BU , 0x1EU , 0x28U , 0x38U , 0x4CU , 0x65U , 0x7FU , 0x99U , 0xB1U , 0xC6U , 0xD6U , 0xE0U , 0xE3U , 0xE0U , 0xD6U
29014  , 0xC6U , 0xB1U , 0x99U , 0x80U , 0x66U , 0x4EU , 0x39U , 0x29U , 0x1FU , 0x1BU , 0x1EU , 0x28U , 0x38U , 0x4CU , 0x65U , 0x7FU , 0x99U , 0xB1U , 0xC6U , 0xD6U , 0xE0U , 0xE3U , 0xE0U , 0xD6U , 0xC6U , 0xB1U , 0x99U , 0x80U , 0x66U ,
29015  0x4EU , 0x39U , 0x29U , 0x1FU , 0x1BU , 0x1EU , 0x28U , 0x38U , 0x4CU , 0x65U , 0x7FU , 0x99U , 0xB1U , 0xC6U , 0xD6U , 0xE0U , 0xE3U , 0xE0U , 0xD6U , 0xC6U , 0xB1U , 0x99U , 0x80U , 0x66U , 0x4EU , 0x39U , 0x29U , 0x1FU , 0x1BU , 0x1EU
29016  , 0x28U , 0x38U , 0x4CU , 0x65U , 0x7FU , 0x99U , 0xB1U , 0xC6U , 0xD6U , 0xE0U , 0xE3U , 0xE0U , 0xD6U , 0xC6U , 0xB1U , 0x99U , 0x80U , 0x66U , 0x4EU , 0x39U , 0x29U , 0x1FU , 0x1BU , 0x1EU , 0x28U , 0x38U , 0x4CU , 0x65U , 0x7FU ,
29017  0x99U , 0xB1U , 0xC6U , 0xD6U , 0xE0U , 0xE3U , 0xE0U , 0xD6U , 0xC6U , 0xB1U , 0x99U , 0x80U , 0x66U , 0x4EU , 0x39U , 0x29U , 0x1FU , 0x1BU , 0x1EU , 0x28U , 0x38U , 0x4CU , 0x65U , 0x7FU , 0x99U , 0xB1U , 0xC6U , 0xD6U , 0xE0U , 0xE3U
29018  , 0xE0U , 0xD6U , 0xC6U , 0xB1U , 0x99U , 0x80U , 0x66U , 0x4EU , 0x39U , 0x29U , 0x1FU , 0x1BU , 0x1EU , 0x28U , 0x38U , 0x4CU , 0x65U } ;
29019 
29020 static const uint8_t
29021  Xmit00 [ 168 ] = /* Array for the FSK frequency generation for a 'Space'.*/
29022  { 0x7FU , 0x99U , 0xB1U , 0xC6U , 0xD6U , 0xE0U , 0xE3U , 0xE0U , 0xD6U , 0xC6U , 0xB1U , 0x99U , 0x80U , 0x66U , 0x4EU , 0x39U , 0x29U , 0x1FU , 0x1BU , 0x1EU , 0x28U , 0x38U , 0x4CU , 0x65U , 0x7FU , 0x99U , 0xB1U , 0xC6U , 0xD6U ,
29023  0xE0U , 0xE3U , 0xE0U , 0xD6U , 0xC6U , 0xB1U , 0x99U , 0x80U , 0x66U , 0x4EU , 0x39U , 0x29U , 0x1FU , 0x1BU , 0x1EU , 0x28U , 0x38U , 0x4CU , 0x65U , 0x7FU , 0x99U , 0xB1U , 0xC6U , 0xD6U , 0xE0U , 0xE3U , 0xE0U , 0xD6U , 0xC6U , 0xB1U
29024  , 0x99U , 0x80U , 0x66U , 0x4EU , 0x39U , 0x29U , 0x1FU , 0x1BU , 0x1EU , 0x28U , 0x38U , 0x4CU , 0x65U , 0x7FU , 0x99U , 0xB1U , 0xC6U , 0xD6U , 0xE0U , 0xE3U , 0xE0U , 0xD6U , 0xC6U , 0xB1U , 0x99U , 0x80U , 0x66U , 0x4EU , 0x39U ,
29025  0x29U , 0x1FU , 0x1BU , 0x1EU , 0x28U , 0x38U , 0x4CU , 0x65U , 0x7FU , 0x99U , 0xB1U , 0xC6U , 0xD6U , 0xE0U , 0xE3U , 0xE0U , 0xD6U , 0xC6U , 0xB1U , 0x99U , 0x80U , 0x66U , 0x4EU , 0x39U , 0x29U , 0x1FU , 0x1BU , 0x1EU , 0x28U , 0x38U
29026  , 0x4CU , 0x65U , 0x7FU , 0x99U , 0xB1U , 0xC6U , 0xD6U , 0xE0U , 0xE3U , 0xE0U , 0xD6U , 0xC6U , 0xB1U , 0x99U , 0x80U , 0x66U , 0x4EU , 0x39U , 0x29U , 0x1FU , 0x1BU , 0x1EU , 0x28U , 0x38U , 0x4CU , 0x65U , 0x7FU , 0x99U , 0xB1U ,
29027  0xC6U , 0xD6U , 0xE0U , 0xE3U , 0xE0U , 0xD6U , 0xC6U , 0xB1U , 0x99U , 0x80U , 0x66U , 0x4EU , 0x39U , 0x29U , 0x1FU , 0x1BU , 0x1EU , 0x28U , 0x38U , 0x4CU , 0x65U } ;
29028 /**************************************************************************************/
29029 /**************************************************************************************/
29030 /* External Functions */
29031 /**************************************************************************************/
29032 /**************************************************************************************/
29033 /*!*************************************************************************************
29034  Function:
29035  void Prepare_Dwn_Msg( uint8_t Identifier, uint8_t Cmd, uint8_t Msg_Length )
29036  Summary:
29037  Receives information from the command parser and stores it into the DwnMsg (FSK)
29038  structure for transmission by FSK.
29039  Description:
29040  Receives information from the command parser and stores it into the DwnMsg (FSK)
29041  structure for transmission by FSK. No other action is performed on the data here.
29042  The DwnMsg (FSK) elements can be manipulated prior to the FSK transmission to
29043  create the final MESSAGE array for longer commands.
29044 
29045  Precondition:
29046  None.
29047  Parameters:
29048  uint8_t Identifier: The lower 3 bits of Frame 4 from the Protocol B command.
29049  uint8_t Cmd: Frame 0 from the Protocol B command.
29050  uint8_t msgLength: The FSK message length in bits.
29051  Returns
29052  None.
29053 
29054  Remarks
29055  None.
29056 
29057  Example:
29058  Prepare_Dwn_Msg(ident,cmd, 20)
29059  */
29060 
29061 void
29062  Prepare_Dwn_Msg (
29063  uint8_t Identifier ,
29064  uint8_t Cmd ,
29065  uint8_t Msg_Length ) ;
29066 /*!*************************************************************************************
29067  Function:
29068  void Generate_Sine_Wave_Data( float32_t NoOfTicks )
29069  Summary:
29070  This function stores sine wave inter step time values into two arrays at
29071  initialization and if the FSK frequency needs to be adjusted. These values
29072  represent the amount of time between updates of the sine wave data DAC used to
29073  generate a 1 or 0.
29074  Description:
29075  This function stores sine wave inter step time values into two arrays at
29076  initialization and if the FSK frequency needs to be adjusted. The TimeMark array
29077  is for the time between a 'MARK' update and the TimeSpace array is for the time
29078  between a 'SPACE' update. Changing the time between the updates will effectively
29079  change the transmitted frequency for a 'MARK' or 'SPACE'. This occurs if there
29080  are errors during the data transmission to a PerfSwitch. This can occur as the
29081  PerfSwitch gets hot when it is down hole.
29082 
29083  Precondition:
29084  None.
29085  Parameters:
29086  float32_t NoOfTicks: This is an error factor used to correct the inter step
29087  time values.
29088  Returns
29089  None.
29090 
29091  Remarks
29092  None.
29093 
29094  Example:
29095  void GenerateSineWaveData( float32_t NoOfTicks )
29096  */
29097 
29098 void
29100  float32_t NoOfTicks ) ;
29101 /**************************************************************************************/
29102 /**************************************************************************************/
29103 /* Local Functions */
29104 /**************************************************************************************/
29105 /**************************************************************************************/
29106 /*!*************************************************************************************
29107  Function:
29108  static void Init_FSK( void )
29109  Summary:
29110  Function to initialize the FSK parameters.
29111  Description:
29112  Function to initialize the FSK parameters. All of the flags and table data are
29113  set to their initial condition. Timer 2 is also started. It is set to 160nS and
29114  is used to count the time between the Manchester transitions.
29115 
29116  Precondition:
29117  None.
29118  Parameters:
29119  None.
29120  Returns:
29121  None.
29122 
29123  Remarks:
29124  None.
29125 
29126  Example:
29127  Init_FSK()
29128  */
29129 
29130 static void
29131  Init_FSK ( void ) ;
29132 /*!*************************************************************************************
29133  Function:
29134  static void Send_Space( void )
29135  Summary:
29136  This function sends a FSK 0 or 'SPACE'.
29137  Description:
29138  This function sends a FSK 0 or 'SPACE'. It is called from the SendMessage
29139  function. sendSpace reads the Xmit00 array and sends the data to the FSK DAC.
29140  The time between the updates is controlled by a timer matching the corresponding
29141  value of the TimeSpace array. An FSK 'zero' is approximately 2800 Hz with
29142  7 cycles lasting approximately 2.5 ms.
29143 
29144  Precondition:
29145  None.
29146  Parameters:
29147  None.
29148  Returns
29149  None.
29150 
29151  Remarks
29152  None.
29153 
29154  Example:
29155  SendSpace()
29156  */
29157 
29158 static void
29159  Send_Space ( void ) ;
29160 /*!*************************************************************************************
29161  Function:
29162  static void Send_Mark( void )
29163  Summary:
29164  This function sends a FSK 1 or 'MARK'.
29165  Description:
29166  This function sends a FSK 1 or 'MARK'. It is called from the Send_Message_Task
29167  function. Send_Mark reads the Xmit11 array and sends the data to the FSK DAC.
29168  The time between the updates is controlled by a timer matching the corresponding
29169  value of the TimeMark array. An FSK 'one' is approximately 5200 Hz with
29170  13 cycles lasting approximately 2.5 ms.
29171 
29172  Precondition:
29173  None.
29174  Parameters:
29175  None.
29176  Returns
29177  None.
29178 
29179  Remarks
29180  None.
29181 
29182  Example:
29183  sendMark()
29184  */
29185 
29186 static void
29187  Send_Mark ( void ) ;
29188 /**************************************************************************************/
29189 /**************************************************************************************/
29190 /* State Machine Functions */
29191 /**************************************************************************************/
29192 /**************************************************************************************/
29193 /*!*************************************************************************************
29194  Function:
29195  void FSK_Tasks(void)
29196  Summary:
29197  FSK_Tasks function
29198  Description:
29199  This routine is the FSK_Tasks function. It defines the FSK_Tasks state
29200  machine and core logic. This machine is used to send an FSK message to a
29201  PerfSwitch. It checks to see if there is a message for Tx and decides if it is a
29202  short or a long message. For a long message, it calculates the CRC and appends
29203  it to the Message and calls Send_Message_Tasks. If a good Manchester response is
29204  received, it resets all flags and prepares to send another message. Otherwise,
29205  it prepares to resend the previous message at a corrected frequency.
29206 
29207  Precondition:
29208  The system ("SYS_Initialize") and application ("APP_Initialize")initialization
29209  should be called before calling this.
29210  Parameters:
29211  None.
29212  Returns:
29213  None.
29214  Remarks:
29215  This routine must be called from the APP_Tasks() routine.
29216  Example:
29217  FSK_Tasks()
29218  */
29219 
29220 void
29221  FSK_Tasks ( void ) ;
29222 /*!*************************************************************************************
29223  Function:
29224  static void Send_Message_Tasks(void)
29225  Summary:
29226  Send_Message_Tasks function
29227  Description:
29228  This routine is the Send_Message_Tasks function. It defines the Send_Message_Tasks
29229  state machine and core logic. This machine is used to send an FSK message to a
29230  PerfSwitch. It can control the MAnchester bias DAC. It then controls the PREAMBLE
29231  (PRE_MSG) state machine to send the preamble. Then the actual message is sent.
29232  Precondition:
29233  The system ("SYS_Initialize") and application ("APP_Initialize")initialization
29234  should be called before calling this.
29235  Parameters:
29236  None.
29237  Returns:
29238  None.
29239  Remarks:
29240  This routine must be called from the FSK_Tasks() routine.
29241  Example:
29242  Send_Message_Tasks()
29243  */
29244 
29245 static void
29246  Send_Message_Tasks ( void ) ;
29247  /* FSK_H */
29248 /***************************************************************************************
29249  End of File
29250  */
29251 
29252 #endif /*00 C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\fsk.h*/
29253 /* CLOSE_FILE Include File */
29254 
29255 /* OPEN FILE C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\man.h */
29256 /**************************************************************************************/
29270 /**************************************************************************************/
29271 #ifndef MAN_H /* Guard against multiple inclusion.*/
29272 #define MAN_H
29273 /**************************************************************************************/
29274 /**************************************************************************************/
29275 /* Section: Included Files */
29276 /**************************************************************************************/
29277 /**************************************************************************************/
29278 #include <stdbool.h>
29279 #include "../system_config.h"
29280 #include "../system_definitions.h"
29281 /**************************************************************************************/
29282 /**************************************************************************************/
29283 /* Section: Defines */
29284 /**************************************************************************************/
29285 /**************************************************************************************/
29286 /* Define the upper and lower bounds for Manchester data, TMR4 tick = 200nsec * 8 = 1.6usec */
29287 /* Define the upper and lower bounds for Manchester data, TMR2 tick = 10nS * 16 = 160nS. */
29288 //#define ManHalfUpper 1171 /* 1.8736 mS.*/
29289 //#define ManHalfLower 500 /* 0.8 mS.*/
29290 //#define ManFullUpper 1953 /* 3.12148 mS.*/
29291 //#define ManFullLower 1172 /* 1.8752 mS.*/
29292 //#define ManHalfUpper 6400 /* 1.8736 mS.?*/ /* time div = 32*/
29293 //#define ManHalfLower 1000 /* 0.8 mS.?*/
29294 //#define ManFullUpper 10000 /* 3.12148 mS.?*/
29295 //#define ManFullLower 6401 /* 1.8752 mS.?*/
29296 #define ManHalfUpper 11800U
29297 #define ManHalfLower 2000U
29298 #define ManFullUpper 20000U
29299 #define ManFullLower 11801U
29300 #define NoManBits 32U
29301 #define HalfBit 0x12U
29302 #define FullBit 0x10U
29303 #define SizeOfBiasLUT 48U
29304 /**************************************************************************************/
29305 /**************************************************************************************/
29306 /* Section: Data Types */
29307 /**************************************************************************************/
29308 /**************************************************************************************/
29309 
29310 typedef
29311 float
29312  float32_t ;
29313 /**************************************************************************************/
29314 /* MAN states
29315  Summary:
29316  MAN states enumeration
29317  Description:
29318  This enumeration defines the valid MAN states. These states determine the
29319  behavior of the MAN state machine at various times. This machine controls when
29320  the MAN_RX and MAN_PROCESS machines execute their states.
29321 */
29322 
29323 typedef
29324  enum
29325  {
29332  } MAN_STATES ;
29333 /**************************************************************************************/
29334 /* MAN_RX_STATES
29335  Summary:
29336  MAN_RX_STATES enumeration
29337  Description:
29338  This enumeration defines the valid MAN_RX_STATES. These states determine the
29339  behavior of the MAN_RX_STATES machine at various times. This machine receives
29340  the data from a PerfSwtich.
29341 */
29342 
29343 typedef
29344  enum
29345  {
29349  } MAN_RX_STATES ;
29350 /**************************************************************************************/
29351 /* MAN_PROCESS_STATES
29352  Summary:
29353  MAN_PROCESS_STATES enumeration
29354  Description:
29355  This enumeration defines the valid MAN_PROCESS_STATES. These states
29356  determine the behavior of the MAN_PROCESS_STATES machine at various times.
29357 */
29358 
29359 typedef
29360  enum
29361  {
29365  } MAN_PROCESS_STATES ;
29366 /**************************************************************************************/
29367 /* MAN_DATA
29368  Summary:
29369  Holds MAN_DATA used for the Manchester tasks.
29370  Description:
29371  Holds MAN_DATA used for the Manchester tasks. The state machines and variables
29372  used to control Manchester functions are stored here.
29373  Remarks:
29374  None
29375  */
29376 
29377 typedef
29378  struct
29379  {
29380  MAN_STATES state ;
29381  MAN_RX_STATES Rx_state ;
29382  MAN_PROCESS_STATES Process_state ;
29383  uint16_t preamble [ 5 ] ;
29384  uint16_t time [ 96 ] ;
29385  uint8_t level [ 96 ] ;
29386  uint8_t ans [ 32U + 2 ] ;
29387  uint8_t msg [ 4 ] ;
29388  uint8_t cnt_preamble ;
29389  uint8_t trynumber ;
29390  bool process_complete_flag ;
29391  bool spi_write_complete_flag ;
29392  bool spi_sent_flag ;
29393  uint8_t timer_count ;
29394  uint8_t timer_complete ;
29395  bool tick ;
29396  bool bad_crc ;
29397  bool error ;
29398  bool manual_bias_flag ;
29399  uint8_t crc ;
29400  } MAN_DATA ;
29401 
29402 extern MAN_DATA
29403  MAN ;
29404 /**************************************************************************************/
29405 /* MAN_BIAS_DATA
29406  Summary:
29407  Holds MAN_BIAS_DATA
29408  Description:
29409  This structure holds the MAN_BIAS_DATA. It is used to adjust the bias value of
29410  the Manchester DAC.
29411  Remarks:
29412  None
29413  */
29414 
29415 typedef
29416  struct
29417  {
29418  DRV_HANDLE spi_bias_fsk ;
29419  DRV_SPI_BUFFER_HANDLE bufferHandle ;
29420  DRV_SPI_BUFFER_HANDLE bufferHandle2 ;
29421  uint16_t adj [ 1 ] ;
29422  uint16_t dac_a_setting ;
29423  uint16_t dac_b_setting ;
29424  float32_t hi_current ;
29425  float32_t lo_current ;
29426  float32_t lo_volts ;
29427  float32_t hi_volts ;
29428  float32_t slope ;
29429  float32_t offset ;
29430  uint8_t index ;
29431  } MAN_BIAS_DATA ;
29432 
29433 extern MAN_BIAS_DATA
29434  MAN_BIAS ;
29435 /**************************************************************************************/
29436 /**************************************************************************************/
29437 /* Local Functions */
29438 /**************************************************************************************/
29439 /**************************************************************************************/
29440 /*!*************************************************************************************
29441  Function:
29442  static void Init_Manchester( void )
29443  Summary:
29444  Function to initialize the Manchester parameters.
29445  Description:
29446  Function to initialize the Manchester parameters.
29447 
29448  Precondition:
29449  None.
29450  Parameters:
29451  None.
29452  Returns:
29453  None.
29454 
29455  Remarks:
29456  None.
29457 
29458  Example:
29459  Init_Manchester()
29460  */
29461 
29462 static void
29463  Init_Manchester ( void ) ;
29464 /*!*************************************************************************************
29465  Function:
29466  static bool Check_Manchester( void )
29467  Summary:
29468  This routine checks for valid Manchester response.
29469  Description:
29470  This routine checks for valid Manchester response. The first two bytes are
29471  checked. If both are zero, then we did not receive a valid response. This is
29472  used in the function Test_Manchester.
29473 
29474  Precondition:
29475  None.
29476  Parameters:
29477  None.
29478  Returns:
29479  bool ans
29480 
29481  Remarks:
29482  None.
29483 
29484  Example:
29485  if( Check_Manchester( ) == true )
29486  */
29487 
29488 static bool
29489  Check_Manchester ( void ) ;
29490 /*!*************************************************************************************
29491  Function:
29492  static void Decode_Manchester( void )
29493  Summary:
29494  Function to decode the Manchester response from a PerfSwitch.
29495  Description:
29496  Function to decode the Manchester response from a PerfSwitch. The MAN.level
29497  and MAN.time arrays are used to generate the MAN.ANS array.
29498  MAN.level[] - level of the incoming data.
29499  MAN.time[] - time of corresponding wave timer ticks.
29500 
29501  The last 1 of the preamble is always in the data so we have a fixed starting point.
29502 
29503  Precondition:
29504  None.
29505  Parameters:
29506  None.
29507  Returns:
29508  None.
29509 
29510  Remarks:
29511  None.
29512 
29513  Example:
29514  Decode_Manchester()
29515  */
29516 
29517 static void
29518  Decode_Manchester ( void ) ;
29519 /*!*************************************************************************************
29520  Function:
29521  static void Package_Manchester( void )
29522  Summary:
29523  Function to prepare Manchester response for further processing.
29524  Description:
29525  Function to prepare Manchester response for further processing. The Manchester
29526  response is decoded and the 1 X 32 answer array is packed into a 4 X 8 bit
29527  message array.
29528 
29529  Precondition:
29530  None.
29531  Parameters:
29532  None.
29533  Returns:
29534  None.
29535 
29536  Remarks:
29537  None.
29538 
29539  Example:
29540  Package_Manchester()
29541  */
29542 
29543 static void
29544  Package_Manchester ( void ) ;
29545 /*!*************************************************************************************
29546  Function:
29547  static void Test_Manchester (void)
29548  Summary:
29549  Function to test the returned Manchester message.
29550  Description:
29551  Function to test the returned Manchester message. The first two bytes are checked
29552  to make sure they are not both 0. If they are not, the FSK frequencies are
29553  adjusted, and the CRC is checked. If the CRC is a match, then a response message
29554  to the host is prepared. Otherwise, up to two different FSK frequencies are
29555  tried in order to establish communications with a PerfSwitch.
29556 
29557  Precondition:
29558  None.
29559  Parameters:
29560  None.
29561  Returns:
29562  None.
29563 
29564  Remarks:
29565  None.
29566 
29567  Example:
29568  Test_Manchester ()
29569  */
29570 
29571 static void
29572  Test_Manchester ( void ) ;
29573 /*!*************************************************************************************
29574  Function:
29575  static void Flush_Buffer_Manchester( void )
29576  Summary:
29577  Function to reset MAN.level[], MAN.time[], MAN.msg[] and MAN.preamble[] buffers.
29578  Description:
29579  Function to reset MAN.level[], MAN.time[], MAN.msg[] and MAN.preamble[] buffers.
29580  These are flushed after every reception.
29581 
29582  Precondition:
29583  None.
29584  Parameters:
29585  None.
29586  Returns:
29587  None.
29588 
29589  Remarks:
29590  None.
29591 
29592  Example:
29593  Flush_Buffer_Manchester()
29594  */
29595 
29596 static void
29597  Flush_Buffer_Manchester ( void ) ;
29598 /*!*************************************************************************************
29599  Function:
29600  static float32_t Calc_Fsk_Scaling( void )
29601  Summary:
29602  Function to calculate the amount of FSK adjustment needed based on the preamble bit
29603  timer counts.
29604  Description:
29605  Function to calculate the amount of FSK adjustment needed based on the preamble bit
29606  timer counts. The average of the timer counts is used to determine the amount
29607  of adjustment. The result is a multiplier used in the Generate_Sine_Wave _Data
29608  function to change the amount of time between the FSK DAC updates. Adjustments
29609  up to 10% have been seen in temperature testing. Adjustments are generally
29610  greater than 1 when a PerfSwitch is hot and less than 1 when a PerfSwitch is cold.
29611 
29612  Precondition:
29613  None.
29614  Parameters:
29615  None.
29616  Returns:
29617  None.
29618 
29619  Remarks:
29620  None.
29621 
29622  Example:
29623  CalcFskScaling( )
29624  */
29625 
29626 static float32_t
29627  Calc_Fsk_Scaling ( void ) ;
29628 /**************************************************************************************/
29629 /**************************************************************************************/
29630 /* Interface Functions */
29631 /**************************************************************************************/
29632 /**************************************************************************************/
29633 /*!*************************************************************************************
29634  Function:
29635  void Calc_Auto_Bias(void)
29636  Summary:
29637  Function to calculate the amount of bias adjust required and to transmit that
29638  result via a SPI port to the Manchester bias DAC.
29639  Description:
29640  Function to calculate the amount of bias adjust required and to transmit that
29641  result via a SPI port to the Manchester bias DAC.
29642 
29643  Precondition:
29644  None.
29645  Parameters:
29646  None.
29647  Returns:
29648  None.
29649 
29650  Remarks:
29651  None.
29652 
29653  Example:
29654  CalcAutoBias()
29655  */
29656 
29657 void
29658  Calc_Auto_Bias ( void ) ;
29659 /*!*************************************************************************************
29660  Function:
29661  void Set_Bias(uint8_t value)
29662  Summary:
29663  Function to transmit the bias adjust value via an SPI port to the Manchester
29664  bias DAC.
29665  Description:
29666  Function to transmit the bias adjust value via an SPI port to the Manchester
29667  bias DAC. Value is integer between 0 and 47. Values greater than 47 are set to 47.
29668 
29669  Precondition:
29670  None.
29671  Parameters:
29672  uint8_t value
29673  Returns:
29674  None.
29675 
29676  Remarks:
29677  None.
29678 
29679  Example:
29680  Set_Bias(uint8_t value)
29681  */
29682 
29683 void
29684  Set_Bias (
29685  uint8_t value ) ;
29686 /**************************************************************************************/
29687 /**************************************************************************************/
29688 /* State Machine Functions */
29689 /**************************************************************************************/
29690 /**************************************************************************************/
29691 /*!*************************************************************************************
29692  Function:
29693  void MAN_Tasks(void)
29694  Summary:
29695  MAN tasks function
29696  Description:
29697  This routine is the MAN tasks function. It defines the MAN's state machine and
29698  core logic. This machine controls the MAN operation and sets flags indicating
29699  new values are available from the system interrupt routine for use in other parts
29700  of the application. It also controls when the MAN_Process_Tasks machine and
29701  MAN_RX_Tasks machines operate.
29702  Precondition:
29703  The system ("SYS_Initialize") and application ("APP_Initialize")initialization
29704  should be called before calling this.
29705  Parameters:
29706  None.
29707  Returns:
29708  None.
29709  Example:
29710  MAN_Tasks()
29711 
29712  Remarks:
29713  This routine must be called from the APP_Tasks() routine.
29714  */
29715 
29716 void
29717  MAN_Tasks ( void ) ;
29718 /*!*************************************************************************************
29719  Function:
29720  static void MAN_PROCESS_Tasks(void)
29721  Summary:
29722  MAN_PROCESS tasks function
29723  Description:
29724  This routine is the MAN_PROCESS tasks function. It defines the MAN_PROCESS's
29725  state machine and core logic. This machine controls the MAN_Process operation. It
29726  decodes, packages, tests and prepares for another message to process.
29727 
29728  During packaging, the 32 bit Manchester response is packaged into a 4 byte array.
29729 
29730  During testing, the CRC is checked and the appropriate response is prepared to
29731  send to the host. If a bad response was received, the FSK frequencies are adjusted
29732  and two more attempts are made to retrieve a valid response.
29733 
29734  Precondition:
29735  The system ("SYS_Initialize") and application ("APP_Initialize")initialization
29736  should be called before calling this.
29737  Parameters:
29738  None.
29739  Returns:
29740  None.
29741  Example:
29742  MAN_PROCESS_Tasks()
29743 
29744  Remarks:
29745  This routine must be called from the MAN_Tasks() routine.
29746  */
29747 
29748 static void
29749  MAN_PROCESS_Tasks ( void ) ;
29750 /*!*************************************************************************************
29751  Function:
29752  void MAN_RX_Tasks(void)
29753  Summary:
29754  MAN_Rx tasks function
29755  Description:
29756  This routine is the MAN_Rx tasks function. It defines the MAN_Rx's
29757  state machine and core logic. It determines if a proper message preamble has
29758  been received and determines the time and input level state when a transition
29759  occurs. This routine is called when there is a high to low change on the port pin.
29760 
29761  The state MAN_RX_STATE_IDLE has no effect on Manchester processing.
29762  The state MAN_RX_STATE_PREAMBLE is responsible for syncing up to a 1111.
29763  The state MAN_RX_STATE_DATA receives the data. The time ranges allow for variances
29764  between PerfSwitches and how they perform over temperature.
29765 
29766  Precondition:
29767  The system ("SYS_Initialize") and application ("APP_Initialize")initialization
29768  should be called before calling this.
29769  Parameters:
29770  None.
29771  Returns:
29772  None.
29773  Example:
29774  MAN_RX_Tasks()
29775 
29776  Remarks:
29777  This routine must be called from the MAN_Tasks() routine.
29778  */
29779 
29780 void
29781  MAN_RX_Tasks ( void ) ;
29782  /* MAN_H */
29783 /***************************************************************************************
29784  End of File
29785  */
29786 
29787 #endif /*00 C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\man.h*/
29788 /* CLOSE_FILE Include File */
29789 
29790 /* OPEN FILE C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\switches.h */
29791 /**************************************************************************************/
29807 /**************************************************************************************/
29808 #ifndef SWITCHES_H /* Guard against multiple inclusion.*/
29809 #define SWITCHES_H
29810 /**************************************************************************************/
29811 /**************************************************************************************/
29812 /* Section: Included Files */
29813 /**************************************************************************************/
29814 /**************************************************************************************/
29815 #include <stdint.h>
29816 #include <stdbool.h>
29817 /**************************************************************************************/
29818 /**************************************************************************************/
29819 /* Section: Defines */
29820 /**************************************************************************************/
29821 /**************************************************************************************/
29822 #define S3_NUM_OF_POSITIONS 5U
29823 #define S6_NUM_OF_POSITIONS 3U
29824 #define S4_NUM_OF_POSITIONS 2U
29825 #define S1_NUM_OF_POSITIONS 2U
29826 /**************************************************************************************/
29827 /**************************************************************************************/
29828 /* Section: Data Types */
29829 /**************************************************************************************/
29830 /**************************************************************************************/
29831 /**************************************************************************************/
29832 /* SWITCH states
29833  Summary:
29834  SWITCH states enumeration
29835  Description:
29836  This enumeration defines the valid SWITCH states. These states
29837  determine the behavior of the SWITCH state machine at various times.
29838 */
29839 
29840 typedef
29841  enum
29842  {
29849  } SWITCH_STATES ;
29850 /**************************************************************************************/
29851 /* SWITCH_DATA
29852  Summary:
29853  Holds SWITCH_DATA used for the SWITCH tasks.
29854  Description:
29855  Holds SWITCH_DATA used for the SWITCH tasks. The state machine and variables
29856  used to control SWITCH functions are stored here.
29857  Remarks:
29858  None
29859  */
29860 
29861 typedef
29862  struct
29863  {
29864  SWITCH_STATES state ;
29865  uint8_t knob_switch_S3 [ 5 ] ;
29866  uint8_t key_switch_S6 [ 3 ] ;
29867  uint8_t pol_switch_S4 [ 2 ] ;
29868  uint8_t dump_fire_switch_S7 ;
29869  uint8_t fire_switch_S1 [ 2 ] ;
29870  uint8_t hvps_switch_S5 ;
29871  bool S3_flag ;
29872  bool S6_flag ;
29873  bool S4_flag ;
29874  bool S1_flag ;
29875  uint16_t store_buffer [ 2 ] ;
29876  uint16_t settings ;
29877  uint8_t dump_fire_count ;
29878  bool debounce_flag ;
29879  bool debounce_tick ;
29880  uint8_t read_try ;
29881  } SWITCH_DATA ;
29882 
29883 extern SWITCH_DATA
29884  SWITCH ;
29885 /**************************************************************************************/
29886 /* S3_COMMAND
29887  Summary:
29888  S3_COMMAND enumeration
29889  Description:
29890  This enumeration defines the valid S3_COMMAND results. These states
29891  determine the behavior of the SWITCH state machine at various times.
29892 */
29893 
29894 typedef
29895  enum
29896  {
29902  } S3_COMMAND ;
29903 /**************************************************************************************/
29904 /* S4_COMMAND
29905  Summary:
29906  S4_COMMAND enumeration
29907  Description:
29908  This enumeration defines the valid S4_COMMAND results. These states
29909  determine the behavior of the SWITCH state machine at various times.
29910 */
29911 
29912 typedef
29913  enum
29914  {
29917  } S4_COMMAND ;
29918 /**************************************************************************************/
29919 /* S7_COMMAND
29920  Summary:
29921  S7_COMMAND enumeration
29922  Description:
29923  This enumeration defines the valid S7_COMMAND results. These states
29924  determine the behavior of the S7_SWITCH state machine at various times.
29925 */
29926 
29927 typedef
29928  enum
29929  {
29933  } S7_COMMAND ;
29934 /**************************************************************************************/
29935 /* S1_COMMAND
29936  Summary:
29937  S1_COMMAND enumeration
29938  Description:
29939  This enumeration defines the valid S1_COMMAND results. These states
29940  determine the behavior of the SWITCH state machine at various times.
29941 */
29942 
29943 typedef
29944  enum
29945  {
29948  } S1_COMMAND ;
29949 /**************************************************************************************/
29950 /* S5_COMMAND
29951  Summary:
29952  S5_COMMAND enumeration
29953  Description:
29954  This enumeration defines the valid S5_COMMAND results. These states
29955  determine the behavior of the S5_SWITCH state machine at various times.
29956 */
29957 
29958 typedef
29959  enum
29960  {
29963  } S5_COMMAND ;
29964 /**************************************************************************************/
29965 /* SWITCH_COMMAND
29966  Summary:
29967  Holds SWITCH_COMMAND data used for the SWITCH tasks.
29968  Description:
29969  Holds SWITCH_COMMAND data used for the SWITCH tasks. The state machine and variables
29970  used to control SWITCH_COMMAND functions are stored here.
29971  Remarks:
29972  None
29973  */
29974 
29975 typedef
29976  struct
29977  {
29978  S3_COMMAND S3_state ;
29979  S4_COMMAND S4_state ;
29980  S7_COMMAND S7_state ;
29981  S1_COMMAND S1_state ;
29982  S5_COMMAND S5_state ;
29983  bool dmpfire_flag ;
29984  bool dmpled_tick ;
29985  } SWITCH_COMMAND ;
29986 
29987 extern SWITCH_COMMAND
29988  SW_COM ;
29989 /**************************************************************************************/
29990 /**************************************************************************************/
29991 /* Section: Local Functions */
29992 /**************************************************************************************/
29993 /**************************************************************************************/
29994 /*!*************************************************************************************
29995  Function:
29996  static void read_switches(void)
29997  Summary:
29998  This function determines all of the switch positions.
29999  Description:
30000  This function determines all of the switch positions. It does this by
30001  monitoring all of a given switches lines and ensuring that only one line per
30002  switch is active. For switches with multiple positions, each position is put
30003  into an array. Only one location in a given array can be active or true.
30004  The switch locations are then passed on to be processed and
30005  converted into commands to actuate relays or other activity.
30006 
30007  Precondition:
30008  None.
30009  Parameters:
30010  None.
30011  Returns
30012  None.
30013 
30014  Remarks:
30015  None.
30016 
30017  Example:
30018  read_switches()
30019  */
30020 
30021 static void
30022  read_switches ( void ) ;
30023 /*!*************************************************************************************
30024  Function:
30025  static void process_switches(void)
30026  Summary:
30027  This function converts the front panel switch positions into commands.
30028  Description:
30029  This function converts the front panel switch positions into commands. It does
30030  this by converting a switch active array location into a command that can be
30031  executed. The commands from a switch are held as state machines.
30032 
30033  Precondition:
30034  None.
30035  Parameters:
30036  None.
30037  Returns
30038  None.
30039 
30040  Remarks:
30041  None.
30042 
30043  Example:
30044  process_switches()
30045  */
30046 
30047 static void
30048  process_switches ( void ) ;
30049 /*!*************************************************************************************
30050  Function:
30051  static void execute_switches(void)
30052  Summary:
30053  This function actuates relays based on the front panel switch position.
30054  Description:
30055  This function actuates relays based on the front panel switch position.
30056 
30057  Precondition:
30058  None.
30059  Parameters:
30060  None.
30061  Returns
30062  None.
30063 
30064  Remarks:
30065  None.
30066 
30067  Example:
30068  static void execute_switches()
30069  */
30070 
30071 static void
30072  execute_switches ( void ) ;
30073 /*!*************************************************************************************
30074  Function:
30075  static void store_switches(void)
30076  Summary:
30077  This function stores the switch positions to be transferred to the host.
30078  Description:
30079  This function stores the switch positions to be transferred to the host. The
30080  switch positions are transferred into two 8-bit array locations. This data can
30081  then be sent to the host when requested. No other actions occur with this data.
30082 
30083  Precondition:
30084  None.
30085  Parameters:
30086  None.
30087  Returns
30088  None.
30089 
30090  Remarks:
30091  None.
30092 
30093  Example:
30094  store_switches()
30095  */
30096 
30097 static void
30098  store_switches ( void ) ;
30099 /**************************************************************************************/
30100 /**************************************************************************************/
30101 /* State Machine Functions */
30102 /**************************************************************************************/
30103 /**************************************************************************************/
30104 /*!*************************************************************************************
30105  Function:
30106  void SWITCH_Tasks ( void )
30107  Summary:
30108  SWITCH_Tasks function
30109  Description:
30110  This routine is the SWITCH_Tasks function. It defines the SWITCH_Tasks state
30111  machine and core logic. This machine is used to monitor the front panel switches
30112  and perform the tasks as designated by the switches.
30113  Precondition:
30114  The system ("SYS_Initialize") and application ("APP_Initialize")initialization
30115  should be called before calling this.
30116  Parameters:
30117  None.
30118  Returns:
30119  None.
30120  Remarks:
30121  This routine must be called from the APP_Tasks() routine.
30122  Example:
30123  SWITCH_Task()
30124  */
30125 
30126 void
30127  SWITCH_Tasks ( void ) ;
30128  /* SWITCHES_H */
30129 /***************************************************************************************
30130  End of File
30131  */
30132 
30133 #endif /*00 C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\switches.h*/
30134 /* CLOSE_FILE Include File */
30135 
30136 /* OPEN FILE C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\cf.h */
30137 /**************************************************************************************/
30151 /**************************************************************************************/
30152 #ifndef CF_H /* Guard against multiple inclusion.*/
30153 #define CF_H
30154 /**************************************************************************************/
30155 /**************************************************************************************/
30156 /* Section: Included Files */
30157 /**************************************************************************************/
30158 /**************************************************************************************/
30159 #include "../system_config.h"
30160 #include "../system_definitions.h"
30161 #include <stdbool.h>
30162 /**************************************************************************************/
30163 /**************************************************************************************/
30164 /* Section: Defines */
30165 /**************************************************************************************/
30166 /**************************************************************************************/
30167 #define I_ARRAY_SIZE 50U
30168 
30169 typedef
30170 float
30171  float32_t ;
30172 /**************************************************************************************/
30173 /**************************************************************************************/
30174 /* Section: Data Types */
30175 /**************************************************************************************/
30176 /**************************************************************************************/
30177 /**************************************************************************************/
30178 /* CF_STATES
30179  Summary:
30180  CF_STATES enumeration
30181  Description:
30182  This enumeration defines the valid CF states. These states
30183  determine the behavior of the CF state machine at various times.
30184 */
30185 
30186 typedef
30187  enum
30188  {
30194  } CF_STATES ;
30195 /**************************************************************************************/
30196 /* CF_DATA
30197  Summary:
30198  Holds CFS_DATA used for the CF tasks.
30199  Description:
30200  Holds CF_DATA used for the CF tasks. The state machine and variables
30201  used to control CF functions are stored here.
30202  Remarks:
30203  None
30204  */
30205 
30206 typedef
30207  struct
30208  {
30209  CF_STATES state ;
30210  DRV_HANDLE drvICHandle ;
30211  uint16_t voltage ;
30212  uint16_t voltage_limit ;
30213  uint16_t upper_voltage_limit ;
30214  uint16_t volt_count ;
30215  uint16_t current ;
30216  uint16_t max_current ;
30217  uint16_t current_limit ;
30218  uint16_t upper_current_limit ;
30219  uint8_t over_current_count ;
30220  uint8_t array_count ;
30221  int16_t i_array [ 50U ] ;
30222  int16_t i_sum ;
30223  bool new_current_values_flag ;
30224  bool new_voltage_values_flag ;
30225  bool overcurrent_flag ;
30226  bool overvoltage_flag ;
30227  uint16_t sensor_offset ;
30228  uint16_t sensor_constant ;
30229  bool sensor_offset_tick ;
30230  uint16_t v_array [ 50 ] ;
30231  uint32_t v_sum ;
30232  float32_t v_avg ;
30233  bool tick ;
30234  uint8_t no_count ;
30235  bool array_full ;
30236  uint8_t overvoltage_count ;
30237  } CF_DATA ;
30238 
30239 extern CF_DATA
30240  CF ;
30241 /**************************************************************************************/
30242 /**************************************************************************************/
30243 /* State Machine Functions */
30244 /**************************************************************************************/
30245 /**************************************************************************************/
30246 /*!*************************************************************************************
30247  Function:
30248  *
30249  void CF_Tasks(void)
30250  Summary:
30251  CF_Tasks function
30252  Description:
30253  This routine is the CF_Tasks function. It defines the CF_Tasks state
30254  machine and core logic. This machine is used to monitor the wire-line shooting
30255  power supply (CF) voltage and current and will set flags when those limits
30256  are exceeded. Those flags are monitored by the HV_PS machine and will turn the
30257  supply off if either of those flags are set.
30258  Precondition:
30259  The system ("SYS_Initialize") and application ("APP_Initialize")initialization
30260  should be called before calling this.
30261  Parameters:
30262  None.
30263  Returns:
30264  None.
30265  Remarks:
30266  This routine must be called from the APP_Tasks() routine.
30267  Example:
30268  CF_Tasks()
30269  */
30270 
30271 void
30272  CF_Tasks ( void ) ;
30273  /* CF_H */
30274 /***************************************************************************************
30275  End of File
30276  */
30277 
30278 #endif /*00 C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\cf.h*/
30279 /* CLOSE_FILE Include File */
30280 
30281 /* OPEN FILE C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\hvps.h */
30282 //**************************************************************************************/
30296 /**************************************************************************************/
30297 #ifndef HVPS_H /* Guard against multiple inclusion.*/
30298 #define HVPS_H
30299 /**************************************************************************************/
30300 /**************************************************************************************/
30301 /* Section: Included Files */
30302 /**************************************************************************************/
30303 /**************************************************************************************/
30304 #include "../system_definitions.h"
30305 /**************************************************************************************/
30306 /**************************************************************************************/
30307 /* Section: Data Types */
30308 /**************************************************************************************/
30309 /**************************************************************************************/
30310 /**************************************************************************************/
30311 /* HVPS_STATES
30312  Summary:
30313  HVPS_STATES enumeration
30314  Description:
30315  This enumeration defines the valid HVPS states. These states
30316  determine the behavior of the HVPS state machine at various times.
30317 */
30318 
30319 typedef
30320  enum
30321  {
30334  } HVPS_STATES ;
30335 /**************************************************************************************/
30336 /* HVPS_DATA
30337  Summary:
30338  Holds HVPS_DATA used for the HVPS tasks.
30339  Description:
30340  Holds HVPS_DATA used for the HVPS tasks. The state machine and variables
30341  used to control HVPS functions are stored here.
30342  Remarks:
30343  None
30344  */
30345 
30346 typedef
30347  struct /* This structure collects the variables and states required for these*/
30348  {
30349  /* functions to operate.*/
30350  HVPS_STATES state ;
30351  DRV_HANDLE drvSPIHandle ;
30352  DRV_SPI_BUFFER_HANDLE bufferHandle ;
30353  DRV_SPI_BUFFER_HANDLE bufferHandle2 ;
30354  bool spi_write_complete_flag ;
30355  bool spi_sent_flag ;
30356  uint16_t adj [ 1 ] ;
30357  uint16_t cont_in ;
30358  bool pot_switch ;
30359  bool new_cont_values_flag ;
30360  bool tick ;
30361  uint16_t cont_prev ;
30362  uint16_t cont_new ;
30363  uint16_t count ;
30364  bool pos_dir ;
30365  bool shutdown ;
30366  uint16_t update_rate ;
30367  uint16_t rate_time ;
30368  uint16_t update_count ;
30369  bool update_flag ;
30370  uint16_t voltage ;
30371  uint16_t current ;
30372  uint16_t sensor_offset ;
30373  uint16_t offset ;
30374  uint16_t sensor_constant ;
30375  uint16_t max_current ;
30376  uint16_t current_limit ;
30377  uint16_t upper_current_limit ;
30378  uint8_t over_current_count ;
30379  bool new_current_values_flag ;
30380  bool new_voltage_values_flag ;
30381  bool overcurrent_flag ;
30382  bool overvoltage_flag ;
30383  } HVPS_DATA ;
30384 
30385 extern HVPS_DATA
30386  HV_PS ;
30387 /**************************************************************************************/
30388 /**************************************************************************************/
30389 /* Section: Interface Functions */
30390 /**************************************************************************************/
30391 /**************************************************************************************/
30392 /*!*************************************************************************************
30393  Function:
30394  void Set_HVPS_Ramp_Rate( uint16_t value )
30395  Summary:
30396  This function sets update rate for the HVPS control voltage.
30397  Description:
30398  This function sets update rate for the HVPS control voltage. Value is a rate in
30399  volts/second. This value is then converted to an update rate for the control DAC.
30400  For example, an update value of 100V/second gives an DAC update rate of approx.
30401  20mS. This update rate is used with Timer 1 to control when the control DAC is
30402  updated.
30403 
30404  Precondition:
30405  None.
30406  Parameters:
30407  uint16_t value: Value representing volts/second.
30408  Returns
30409  None.
30410 
30411  Remarks:
30412  None.
30413 
30414  Example:
30415  SET_WL_SPS_IOffset( unsigned char mode )
30416  */
30417 
30418 void
30420  uint16_t value ) ;
30421 /**************************************************************************************/
30422 /**************************************************************************************/
30423 /* State Machine Functions */
30424 /**************************************************************************************/
30425 /**************************************************************************************/
30426 /*!*************************************************************************************
30427  Function:
30428  void HVPS_Tasks(void)
30429  Summary:
30430  HVPS tasks function
30431  Description:
30432  This routine is the HVPS tasks function. It defines the HVPS's state machine and
30433  core logic.
30434  Precondition:
30435  The system ("SYS_Initialize") and application ("APP_Initialize")initialization
30436  should be called before calling this.
30437  Parameters:
30438  None.
30439  Returns:
30440  None.
30441  Example:
30442  HVPS_Tasks()
30443 
30444  Remarks:
30445  This routine must be called from APP_Tasks() routine.
30446  */
30447 
30448 void
30449  HVPS_Tasks ( void ) ;
30450  /* HVPS_H */
30451 /***************************************************************************************
30452  End of File
30453  */
30454 
30455 #endif /*00 C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\hvps.h*/
30456 /* CLOSE_FILE Include File */
30457 
30458 #include <string.h>
30459 #include <stdbool.h>
30460 /**************************************************************************************/
30461 /**************************************************************************************/
30462 /* Section: Defines */
30463 /**************************************************************************************/
30464 /**************************************************************************************/
30465  /* These defines are the various protocol commands.*/
30466  /* Auto Protocol A commands for additional/automated control.*/
30467 #define Set_WL_SPS_CurrentLimit_Value 0x30U
30468 #define Get_WL_SPS_CurrentLimit 0x31U
30469 #define Set_HVPS_Ramp_Rate_Value 0x32U
30470 #define HVPS_Supply_On 0x33U
30471 #define HVPS_Supply_Off 0x34U
30472 #define APA_COM_6 0x35U
30473 #define APA_COM_7 0x36U
30474 #define APA_COM_8 0x37U
30475 #define APA_COM_9 0x38U
30476 #define APA_COM_10 0x39U
30477 #define APA_COM_11 0x3AU
30478 #define APA_COM_12 0x3BU
30479 #define APA_COM_13 0x3CU
30480 #define APA_COM_14 0x3DU
30481 #define APA_COM_15 0x3EU
30482 #define APA_COM_16 0x3FU
30483 #define APA_COM_17 0x40U
30484 #define APA_COM_18 0x41U
30485 #define APA_COM_19 0x43U
30486 #define APA_COM_20 0x44U
30487 #define APA_COM_21 0x45U
30488  /* Auto protocol A commands end here.*/
30489  /* Protocol A Commands Start.*/
30490 #define Set_WL_CPS_CurrentLimit_Value 0x50U
30491 #define Get_WL_CPS_Current 0x51U
30492 #define Get_WL_CPS_CurrentMax 0x52U
30493 #define Get_WL_CPS_CurrentLimit 0x53U
30494 #define Set_WL_CPS_Voltage 0x54U
30495 #define WL_CPS_Off 0x55U
30496 #define WL_CPS_On 0x56U
30497 #define Get_WL_CPS_Voltage 0x57U
30498 #define Set_MAN_Bias_Auto 0x58U
30499 #define Set_MAN_Bias_Manual 0x59U
30500 #define Get_MAN_Bias 0x5AU
30501 #define Get_PIB_Revision 0x5BU
30502 #define Get_PIB_Status 0x5CU
30503 #define Get_FP_Switch_Settings 0x5DU
30504 #define Close_COMM_Relay 0x5EU
30505 #define Open_COMM_Relay 0x5FU
30506 #define SetK1Log 0x60U
30507 #define SetK1Perf 0x61U
30508 #define Get_WL_SPS_I_V 0x62U
30509 #define Get_WL_CPS_I_V 0x63U
30510 #define PA_COM_21 0x64U
30511 #define Initialize 0x65U
30512 #define SetK2Log 0x66U
30513 #define SetK2Perf 0x67U
30514 #define PA_COM_22 0x68U
30515 #define PA_COM_23 0x69U
30516 #define PA_COM_24 0x6AU
30517 #define PA_COM_25 0x6BU
30518 #define PA_COM_26 0x6CU
30519 #define PA_COM_27 0x6DU
30520 #define PA_COM_28 0x6EU
30521 #define PA_COM_29 0x6FU
30522 #define PA_COM_30 0x70U
30523  /* Protocol A Commands end.*/
30524  /* Protocol B Commands start.*/
30525 #define Short_Message30mA 0x80U
30526 #define Switch_WL_ON_Hibernate 0x81U
30527 #define Switch_ARM 0x82U
30528 #define SS_WL_FET_1_ON 0x83U
30529 #define LongMessage 0x84U
30530 #define SS_WL_FET_1_OFF 0x85U
30531 #define SS_WL_FET_2_ON 0x86U
30532 #define SS_WL_FET_2_OFF 0x87U
30533 #define Switch_Fire_12sec 0x88U
30534 #define Switch_Fire_30sec 0x89U
30535 #define Get_Switch_Rev 0x8AU
30536 #define Get_SS_Temp 0x8BU
30537 #define Short_Message10mA 0x8CU
30538 #define Get_Voltage 0x8DU
30539 #define SS_WL_FET_3_ON 0x8EU
30540 #define SS_WL_FET_3_OFF 0x8FU
30541 #define SS_WL_FET_4_ON 0x90U
30542 #define SS_WL_FET_4_OFF 0x91U
30543 #define Open_Mot_Rel_Tool 0x92U
30544 #define Close_Mot_Rel_Tool 0x93U
30545 #define PB_COM_16 0x94U
30546 #define Get_Device_Type 0x95U
30547 #define Get_Det_Detect 0x96U
30548 #define Switch_Fire_120sec 0x97U
30549 #define PB_COM_20 0x98U
30550 #define PB_COM_21 0x99U
30551 #define PB_COM_22 0x9AU
30552 #define PB_COM_23 0x9BU
30553 #define PB_COM_24 0x9CU
30554 #define PB_COM_25 0x9DU
30555 #define PB_COM_26 0x9EU
30556 #define PB_COM_27 0x9FU
30557 #define PB_COM_28 0xA0U
30558 #define PB_COM_29 0xA1U
30559 #define PB_COM_30 0xA2U
30560 #define PB_COM_31 0xA3U
30561 #define PB_COM_32 0xA4U
30562 #define PB_COM_33 0xA5U
30563 #define PB_COM_34 0xA6U
30564 #define PB_COM_35 0xA7U
30565 #define PB_COM_36 0xA8U
30566 #define PB_COM_37 0xA9U
30567 #define PB_COM_38 0xAAU
30568 #define PB_COM_39 0xABU
30569 #define PB_COM_40 0xACU
30570 #define PB_COM_41 0xADU
30571 #define PB_COM_42 0xAEU
30572 #define PB_COM_43 0xAFU
30573 #define Command_Wait 0xB0U
30574  /* Protocol B Commands end.*/
30575 #define NoOfCommands 103
30576 /**************************************************************************************/
30577 /**************************************************************************************/
30578 /* Section: Type Definition */
30579 /**************************************************************************************/
30580 /**************************************************************************************/
30581 /**************************************************************************************/
30582 /**************************************************************************************/
30583 /* Section: Structure Data and Local Variables */
30584 /**************************************************************************************/
30585 /**************************************************************************************/
30586 /* COMMAND Data
30587  Summary:
30588  These structures hold required data.
30589  Description:
30590  These structures hold required data. These are here to link these
30591  structures for use by the local functions.
30592  Remarks:
30593  *
30594  These are defined in command.h
30595 */
30596 
30599 
30600 static COMMAND_STATES
30602 /***************************************************************************************
30603 * $GLOBAL VARIABLES
30604 ***************************************************************************************/
30605 
30606 bool
30607  DepthStatus = true ;
30608 /**************************************************************************************/
30609 /**************************************************************************************/
30610 /* Section: State Machine Functions */
30611 /**************************************************************************************/
30612 /**************************************************************************************/
30613 /***************************************************************************************
30614  Function:
30615  void COMMAND_Tasks ( void )
30616  Summary:
30617  This routine is the COMMAND_Tasks function. It defines the (COMMAND) state
30618  machine and core logic.
30619  Remarks:
30620  Refer to the commands.h interface header for function usage details.
30621  */
30622 
30623 void
30624  COMMAND_Tasks ( void ) /* COMMAND state machine.*/
30625  {
30626  int izzqqzz=((int)(bitmapstruct.element1 |= (1 << 28))); /* 37 */
30627  switch (
30628  ( ( int )( /* 29 */
30629  CMD.state
30630  ))*
30631  ((bitmapstruct.element1 |= ((( 1== 1)||(qqqzzglobflag == 1)) ? ( qqqzzglobflag ^= 1, 1 << 29) : 0)), 1 ) /* 19 */
30632  ) /* Check the machines current state.*/
30633  {
30634  case COMMAND_STATE_INIT :
30635  ((bitmapstruct.element1 |= ((( 0== 1)||(qqqzzglobflag == 1)) ? ( qqqzzglobflag ^= 1, 1 << 30) : 0)), 1 ); /* 41 */
30636  /* This machines initial state.*/
30637  {
30638  CMD.process_complete_flag = true ; /* Flag to show the command execution has been completed.*/
30639  CMD.state = COMMAND_STATE_WAIT ; /* Move on to wait for a host command.*/
30640  CMD.cmd_size = 7 ; /* The number of bytes in a valid command.*/
30641  ( void ) memset ( CMD.command , 0 , CMD.cmd_size ) ;/* Initialize the command bytes to 0 value.*/
30642  CMD.b_command_complete_flag = false ; /* Flag to show if a Protocol B command is complete.*/
30643  CMD.sw_status_bit_check = true ; /* Flag to use status bits from PerfSwitch.*/
30644  }
30645  ((int)(bitmapstruct.element1 |= (1 << 31))); /* 16 */
30646  goto l130495 ;
30647  case COMMAND_STATE_WAIT :
30648  ((bitmapstruct.element2 |= ((( 0== 1)||(qqqzzglobflag == 1)) ? ( qqqzzglobflag ^= 1, 1 << 0) : 0)), 1 ); /* 41 */
30649  /* Wait here for a command to be sent from the host.*/
30650  {
30651  if
30652  (
30653  CMD.process_complete_flag == false
30654  ) /* If we have a command that needs processing,*/
30655  {
30656  ((int)(bitmapstruct.element2 |= (1 << 1))); /* 1 */
30657  { /* (set false in commmodule.c)*/
30658  CMD.state = COMMAND_STATE_CRC_CHECK ; /* Move on to check the command array CRC.*/
30659  }
30660  } else ((int)(bitmapstruct.element2 |= (1 << 2))); /* 4 */
30661  }
30662  ((int)(bitmapstruct.element2 |= (1 << 3))); /* 16 */
30663  goto l130495 ;
30665  ((bitmapstruct.element2 |= ((( 0== 1)||(qqqzzglobflag == 1)) ? ( qqqzzglobflag ^= 1, 1 << 4) : 0)), 1 ); /* 41 */
30666  /* Calculate the CRC of the sent command array.*/
30667  {
30668  CMD.crc = Calc_CRC_Array ( 6 , CMD.command ) ;/* Calculate the command array CRC.*/
30669  if
30670  (
30671  CMD.command[ 6 ] == CMD.crc
30672  ) /* If the answer agrees with the fifth array element,*/
30673  {
30674  ((int)(bitmapstruct.element2 |= (1 << 5))); /* 1 */
30675  {
30676  Clear_Status ( 16 ) ;/* Clear the CRC Error status bit and*/
30677  CMD.state = COMMAND_STATE_EXECUTE_CMD ; /* move on to execute the command.*/
30678  }
30679  ((int)(bitmapstruct.element2 |= (1 << 6))); /* 3 */
30680  }
30681  else /* Otherwise,*/
30682  {
30683  ((int)(bitmapstruct.element2 |= (1 << 7))); /* 2 */
30684  {
30685  Set_Status ( 16 ) ;/* set the CRC Error Bit and*/
30686  Prepare_Return_A ( CMD.command[ 0 ] , 0 , 0 ) ;/* prepare the message to be sent back to the host.*/
30687  CMD.state = COMMAND_STATE_WAIT ; /* Wait for another command to process.*/
30688  CMD.process_complete_flag = true ; /* Set this flag to show we have completed processing the command.*/
30689  }
30690  }
30691  }
30692  ((int)(bitmapstruct.element2 |= (1 << 8))); /* 16 */
30693  goto l130495 ;
30695  ((bitmapstruct.element2 |= ((( 0== 1)||(qqqzzglobflag == 1)) ? ( qqqzzglobflag ^= 1, 1 << 9) : 0)), 1 ); /* 41 */
30696  /* Execute the command.*/
30697  {
30698  if
30699  ( /* 50 */
30700  (
30701 
30702  ( /* 52 */
30703  (
30704  CMD.command[ 0 ] >= 0x30U
30705  )
30706  ? (bitmapstruct.element2 |= (1 << 10 ), 1)
30707  : (bitmapstruct.element2 |= (1 << 11 ), 0) ) /* 54 */
30708  &&
30709  ( CMD.command[ 0 ] <= 0x45U )
30710  ) /* If the command is within the Protocol A Auto Command range,*/
30711  ) /* 1 */
30712  {
30713  ((int)(bitmapstruct.element2 |= (1 << 12))); /* 1 */
30714  {
30715  ((int)(bitmapstruct.element2 |= (1 << 13))); /* 23 */
30716 
30717  Execute_Auto_Protocol_A () ; /* execute the command here.*/
30718  CMD.state = COMMAND_STATE_WAIT ; /* Wait for another command to process.*/
30719  }
30720  } else ((int)(bitmapstruct.element2 |= (1 << 14))); /* 4 */
30721  if
30722  ( /* 50 */
30723  (
30724 
30725  ( /* 52 */
30726  (
30727  CMD.command[ 0 ] >= 0x50U
30728  )
30729  ? (bitmapstruct.element2 |= (1 << 15 ), 1)
30730  : (bitmapstruct.element2 |= (1 << 16 ), 0) ) /* 54 */
30731  &&
30732  ( CMD.command[ 0 ] <= 0x70U )
30733  ) /* If the command is within the Protocol A Command range,*/
30734  ) /* 1 */
30735  {
30736  ((int)(bitmapstruct.element2 |= (1 << 17))); /* 1 */
30737  {
30738  ((int)(bitmapstruct.element2 |= (1 << 18))); /* 23 */
30739 
30740  Execute_Protocol_A () ; /* execute the command here.*/
30741  CMD.state = COMMAND_STATE_WAIT ; /* Wait for another command to process.*/
30742  }
30743  ((int)(bitmapstruct.element2 |= (1 << 19))); /* 3 */
30744  }
30745  else
30746  {
30747  ((int)(bitmapstruct.element2 |= (1 << 20))); /* 2 */
30748  {
30749  if
30750  ( /* 50 */
30751  (
30752 
30753  ( /* 52 */
30754  (
30755  CMD.command[ 0 ] >= 0x80U
30756  )
30757  ? (bitmapstruct.element2 |= (1 << 21 ), 1)
30758  : (bitmapstruct.element2 |= (1 << 22 ), 0) ) /* 54 */
30759  &&
30760  ( CMD.command[ 0 ] <= 0xB0U )
30761  ) /* If the command is within the Protocol B Command range,*/
30762  ) /* 1 */
30763  {
30764  ((int)(bitmapstruct.element2 |= (1 << 23))); /* 1 */
30765  {
30766  if
30767  (
30769  ) /* If we have completed processing a protocol B command,*/
30770  {
30771  ((int)(bitmapstruct.element2 |= (1 << 24))); /* 1 */
30772  {
30773  CMD.b_command_complete_flag = false ;/* Reset the flag.*/
30774  CMD.state = COMMAND_STATE_WAIT ;/* Wait for another command to process.*/
30775  CMD.process_complete_flag = true ;/* Set this flag to show we have completed processing the command.*/
30776  CMD.command[ 0 ] = 0x00U ;/* Reset the command.*/
30777  }
30778  } else ((int)(bitmapstruct.element2 |= (1 << 25))); /* 4 */
30779  if
30780  (
30782  ) /* If we have not sent the command yet,*/
30783  {
30784  ((int)(bitmapstruct.element2 |= (1 << 26))); /* 1 */
30785  {
30786  ((int)(bitmapstruct.element2 |= (1 << 27))); /* 23 */
30787 
30788  Execute_Protocol_B () ;/* execute the command here.*/
30789  }
30790  } else ((int)(bitmapstruct.element2 |= (1 << 28))); /* 4 */
30791  }
30792  ((int)(bitmapstruct.element2 |= (1 << 29))); /* 3 */
30793  }
30794  else/* otherwise the command may be a system command and*/
30795  {
30796  ((int)(bitmapstruct.element2 |= (1 << 30))); /* 2 */
30797  {
30798  ((int)(bitmapstruct.element2 |= (1 << 31))); /* 23 */
30799 
30800  Execute_System () ;/* execute those commands here.*/
30801  CMD.state = COMMAND_STATE_WAIT ;/* Wait for another command to process.*/
30802  CMD.process_complete_flag = true ;/* Set this flag to show we have completed processing the command.*/
30803  }
30804  }
30805  }
30806  }
30807  }
30808  ((int)(bitmapstruct.element3 |= (1 << 0))); /* 16 */
30809  goto l130495 ;
30810  default :
30811  ((bitmapstruct.element3 |= ((( 0== 1)||(qqqzzglobflag == 1)) ? ( qqqzzglobflag ^= 1, 1 << 1) : 0)), 1 ); /* 41 */
30812  {
30813  }
30814  ((int)(bitmapstruct.element3 |= (1 << 2))); /* 16 */
30815  goto l130495 ;
30816  }
30817 l130495 :
30818  ; /* 18 */
30819  ((int)(bitmapstruct.element3 |= (1 << 3))); /* 30 */
30820  commands_65zqendz ( 100 ) ; /* 30 */
30821  }
30822 /**************************************************************************************/
30823 /**************************************************************************************/
30824 /* Section: Local Functions */
30825 /**************************************************************************************/
30826 /**************************************************************************************/
30827 /*!*************************************************************************************
30828  Function:
30829  static void Execute_Auto_Protocol_A (void)
30830  Summary:
30831  Function to execute a auto protocol A command.
30832  Remarks:
30833  Refer to the commands.h interface header for function usage details.
30834  */
30835 
30836 static void
30838  {
30839  int izzqqzz=((int)(bitmapstruct.element3 |= (1 << 4))); /* 37 */
30840  switch (
30841  ( ( int )( /* 29 */
30842  CMD.command[ 0 ]
30843  ))*
30844  ((bitmapstruct.element3 |= ((( 1== 1)||(qqqzzglobflag == 1)) ? ( qqqzzglobflag ^= 1, 1 << 5) : 0)), 1 ) /* 19 */
30845  )
30846  {
30847  case 0x30U :
30848  ((bitmapstruct.element3 |= ((( 0== 1)||(qqqzzglobflag == 1)) ? ( qqqzzglobflag ^= 1, 1 << 6) : 0)), 1 ); /* 41 */
30849  /* 30h*/
30850  {
30852  ( uint16_t ) CMD.command[ 5 ] ) ;
30853  CMD.process_complete_flag = true ; /* Set this flag to show we have completed processing the command.*/
30854  Prepare_Return_A ( CMD.command[ 0 ] , 0 , 0 ) ;/* Prepare the protocol A response.*/
30855  CMD.command[ 0 ] = 0x00U ; /* Reset the Command received byte.*/
30856  }
30857  ((int)(bitmapstruct.element3 |= (1 << 7))); /* 16 */
30858  goto l130577 ;
30859  case 0x31U :
30860  ((bitmapstruct.element3 |= ((( 0== 1)||(qqqzzglobflag == 1)) ? ( qqqzzglobflag ^= 1, 1 << 8) : 0)), 1 ); /* 41 */
30861  /* 31h*/
30862  {
30863  CMD.process_complete_flag = true ; /* Set this flag to show we have completed processing the command.*/
30864  Prepare_Return_A ( CMD.command[ 0 ] , 0 , WL_SPS.current_limit ) ;/* Prepare the protocol A response.*/
30865  CMD.command[ 0 ] = 0x00U ; /* Reset the Command received byte.*/
30866  }
30867  ((int)(bitmapstruct.element3 |= (1 << 9))); /* 16 */
30868  goto l130577 ;
30869  case 0x32U :
30870  ((bitmapstruct.element3 |= ((( 0== 1)||(qqqzzglobflag == 1)) ? ( qqqzzglobflag ^= 1, 1 << 10) : 0)), 1 ); /* 41 */
30871  /* 32h*/
30872  {
30873  Set_HVPS_Ramp_Rate ( CMD.command[ 5 ] ) ;
30874  CMD.process_complete_flag = true ; /* Set this flag to show we have completed processing the command.*/
30875  Prepare_Return_A ( CMD.command[ 0 ] , 0 , 0 ) ;/* Prepare the protocol A response.*/
30876  CMD.command[ 0 ] = 0x00U ; /* Reset the Command received byte.*/
30877  }
30878  ((int)(bitmapstruct.element3 |= (1 << 11))); /* 16 */
30879  goto l130577 ;
30880  case 0x33U :
30881  ((bitmapstruct.element3 |= ((( 0== 1)||(qqqzzglobflag == 1)) ? ( qqqzzglobflag ^= 1, 1 << 12) : 0)), 1 ); /* 41 */
30882  /* 33h*/
30883  {
30884  if
30885  (
30886  ( SW_COM.S3_state == RLY_ARM )
30887  ) /* Panel must be in ARM to turn on HVPS.*/
30888  {
30889  ((int)(bitmapstruct.element3 |= (1 << 13))); /* 1 */
30890  {
30891  PLIB_PORTS_PinSet ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_13 ) ;/* Turn the HVPS on.*/
30892  }
30893  } else ((int)(bitmapstruct.element3 |= (1 << 14))); /* 4 */
30894  CMD.process_complete_flag = true ; /* Set this flag to show we have completed processing the command.*/
30895  Prepare_Return_A ( CMD.command[ 0 ] , 0 , 0 ) ;/* Prepare the protocol A response.*/
30896  CMD.command[ 0 ] = 0x00U ; /* Reset the Command received byte.*/
30897  }
30898  ((int)(bitmapstruct.element3 |= (1 << 15))); /* 16 */
30899  goto l130577 ;
30900  case 0x34U :
30901  ((bitmapstruct.element3 |= ((( 0== 1)||(qqqzzglobflag == 1)) ? ( qqqzzglobflag ^= 1, 1 << 16) : 0)), 1 ); /* 41 */
30902  /* 34h*/
30903  {
30904  PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_13 ) ;/* Turn the HVPS off.*/
30905  Clear_Status ( 3 ) ;/* Clear status bit 2 to clear the overvoltage bit.*/
30906  CMD.process_complete_flag = true ; /* Set this flag to show we have completed processing the command.*/
30907  Prepare_Return_A ( CMD.command[ 0 ] , 0 , 0 ) ;/* Prepare the protocol A response.*/
30908  CMD.command[ 0 ] = 0x00U ; /* Reset the Command received byte.*/
30909  }
30910  ((int)(bitmapstruct.element3 |= (1 << 17))); /* 16 */
30911  goto l130577 ;
30912  default :
30913  ((bitmapstruct.element3 |= ((( 0== 1)||(qqqzzglobflag == 1)) ? ( qqqzzglobflag ^= 1, 1 << 18) : 0)), 1 ); /* 41 */
30914  {
30915  CMD.process_complete_flag = true ; /* Set this flag to show we have completed processing the command.*/
30916  Prepare_Return_A ( CMD.command[ 0 ] , 0 , 0 ) ;/* Prepare the protocol A response.*/
30917  CMD.command[ 0 ] = 0x00U ; /* Reset the Command received byte.*/
30918  }
30919  ((int)(bitmapstruct.element3 |= (1 << 19))); /* 16 */
30920  goto l130577 ;
30921  }
30922 l130577 :
30923  ; /* 18 */
30924  ((int)(bitmapstruct.element3 |= (1 << 20))); /* 30 */
30925  commands_65zqendz ( 117 ) ; /* 30 */
30926  }
30927 /*!*************************************************************************************
30928  Function:
30929  static void Execute_Protocol_A (void)
30930  Summary:
30931  Function to execute a protocol A command.
30932  Remarks:
30933  Refer to the commands.h interface header for function usage details.
30934  */
30935 
30936 static void
30938  {
30939  int izzqqzz=((int)(bitmapstruct.element3 |= (1 << 21))); /* 37 */
30940  switch (
30941  ( ( int )( /* 29 */
30942  CMD.command[ 0 ]
30943  ))*
30944  ((bitmapstruct.element3 |= ((( 1== 1)||(qqqzzglobflag == 1)) ? ( qqqzzglobflag ^= 1, 1 << 22) : 0)), 1 ) /* 19 */
30945  )
30946  {
30947  case 0x50U :
30948  ((bitmapstruct.element3 |= ((( 0== 1)||(qqqzzglobflag == 1)) ? ( qqqzzglobflag ^= 1, 1 << 23) : 0)), 1 ); /* 41 */
30949  /* 50h*/
30950  {
30951  Set_WL_CPS_CurrentLimit ( CMD.command[ 5 ] ) ;/* Set the WL_CPS current limit.*/
30952  CMD.process_complete_flag = true ; /* Set this flag to show we have completed processing the command.*/
30953  Prepare_Return_A ( CMD.command[ 0 ] , 0 , WL_CPS.current_limit ) ;/* Prepare the return message.*/
30954  CMD.command[ 0 ] = 0x00U ; /* Reset the Command received byte.*/
30955  }
30956  ((int)(bitmapstruct.element3 |= (1 << 24))); /* 16 */
30957  goto l130933 ;
30958  case 0x51U :
30959  ((bitmapstruct.element3 |= ((( 0== 1)||(qqqzzglobflag == 1)) ? ( qqqzzglobflag ^= 1, 1 << 25) : 0)), 1 ); /* 41 */
30960  /* 51h*/
30961  {
30962  CMD.process_complete_flag = true ; /* Set this flag to show we have completed processing the command.*/
30963  Prepare_Return_A ( CMD.command[ 0 ] , 0 , ( uint16_t ) WL_CPS.current ) ;/* Return the latest WL_CPS current reading.*/
30964  CMD.command[ 0 ] = 0x00U ; /* Reset the Command received byte.*/
30965  }
30966  ((int)(bitmapstruct.element3 |= (1 << 26))); /* 16 */
30967  goto l130933 ;
30968  case 0x52U :
30969  ((bitmapstruct.element3 |= ((( 0== 1)||(qqqzzglobflag == 1)) ? ( qqqzzglobflag ^= 1, 1 << 27) : 0)), 1 ); /* 41 */
30970  /* 52h*/
30971  {
30972  CMD.process_complete_flag = true ; /* Set this flag to show we have completed processing the command.*/
30973  Prepare_Return_A ( CMD.command[ 0 ] , 0 , WL_CPS.max_current ) ;/* Return the maximum WL_CPS current recorded.*/
30974  CMD.command[ 0 ] = 0x00U ; /* Reset the Command received byte.*/
30975  }
30976  ((int)(bitmapstruct.element3 |= (1 << 28))); /* 16 */
30977  goto l130933 ;
30978  case 0x53U :
30979  ((bitmapstruct.element3 |= ((( 0== 1)||(qqqzzglobflag == 1)) ? ( qqqzzglobflag ^= 1, 1 << 29) : 0)), 1 ); /* 41 */
30980  /* 53h*/
30981  {
30982  CMD.process_complete_flag = true ; /* Set this flag to show we have completed processing the command.*/
30983  Prepare_Return_A ( CMD.command[ 0 ] , 0 , WL_CPS.current_limit ) ;/* Return the WL_CPS current limit.*/
30984  CMD.command[ 0 ] = 0x00U ; /* Reset the Command received byte.*/
30985  }
30986  ((int)(bitmapstruct.element3 |= (1 << 30))); /* 16 */
30987  goto l130933 ;
30988  case 0x54U :
30989  ((bitmapstruct.element3 |= ((( 0== 1)||(qqqzzglobflag == 1)) ? ( qqqzzglobflag ^= 1, 1 << 31) : 0)), 1 ); /* 41 */
30990  /* 54h*/
30991  {
30992  if
30993  ( /* 50 */
30994  (
30995 
30996  ( /* 52 */
30997  (
30998  WL_CPS.spi_sent_flag == false
30999  )
31000  ? (bitmapstruct.element4 |= (1 << 0 ), 1)
31001  : (bitmapstruct.element4 |= (1 << 1 ), 0) ) /* 54 */
31002  &&
31003  ( WL_CPS.spi_cont_pot != (
31004  (
31005  ( DRV_HANDLE ) - 1 ) ) )
31006  )
31007  ) /* 1 */
31008  {
31009  ((int)(bitmapstruct.element4 |= (1 << 2))); /* 1 */
31010  {
31011  Adjust_WL_CPS_Voltage ( CMD.command[ 5 ] ) ;/* send the command.*/
31012  WL_CPS.spi_sent_flag = true ; /* Set this flag to show we sent data to the WL_CPS SPI port.*/
31013  }
31014  } else ((int)(bitmapstruct.element4 |= (1 << 3))); /* 4 */
31015  if
31016  (
31018  ) /* If the SPI port is through sending data,*/
31019  {
31020  ((int)(bitmapstruct.element4 |= (1 << 4))); /* 1 */
31021  {
31022  WL_CPS.spi_write_complete_flag = false ; /* reset the flag.*/
31023  CMD.process_complete_flag = true ; /* Set this flag to show we have completed processing the command.*/
31024  Prepare_Return_A ( CMD.command[ 0 ] , 0 , 0 ) ;/* Prepare the protocol A response.*/
31025  CMD.command[ 0 ] = 0x00U ; /* Reset the Command received byte.*/
31026  WL_CPS.spi_sent_flag = false ; /* Reset the flag so we can send data.*/
31027  }
31028  } else ((int)(bitmapstruct.element4 |= (1 << 5))); /* 4 */
31029  }
31030  ((int)(bitmapstruct.element4 |= (1 << 6))); /* 16 */
31031  goto l130933 ;
31032  case 0x55U :
31033  ((bitmapstruct.element4 |= ((( 0== 1)||(qqqzzglobflag == 1)) ? ( qqqzzglobflag ^= 1, 1 << 7) : 0)), 1 ); /* 41 */
31034  /* 55h. WSC, Turn W/L PS OFF.*/
31035  {
31036  PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_G , PORTS_BIT_POS_13 ) ;/* Turn WL_CPS off.*/
31037  Clear_Status ( 9 ) ;/* Clear status bit 8 to show WL_CPS is off.*/
31038  Clear_Status ( 14 ) ;/* Clear status bit 13 to indicate an over current.*/
31039  CMD.process_complete_flag = true ; /* Set this flag to show we have completed processing the command.*/
31040  Prepare_Return_A ( CMD.command[ 0 ] , 0 , 0 ) ;/* Prepare the protocol A response.*/
31041  CMD.command[ 0 ] = 0x00U ; /* Reset the Command received byte.*/
31042  }
31043  ((int)(bitmapstruct.element4 |= (1 << 8))); /* 16 */
31044  goto l130933 ;
31045  case 0x56U :
31046  ((bitmapstruct.element4 |= ((( 0== 1)||(qqqzzglobflag == 1)) ? ( qqqzzglobflag ^= 1, 1 << 9) : 0)), 1 ); /* 41 */
31047  /* 56h*/
31048  {
31049  if
31050  ( /* 50 */
31051  (
31052 
31053  ( /* 51 */
31054  (
31056  )
31057  ? (bitmapstruct.element4 |= (1 << 11 ), 1)
31058  : (bitmapstruct.element4 |= (1 << 10 ), 0) ) /* 54 */
31059  ||
31061  ) /* Panel must be in ARM_CF or ARM_CF_AUTO to turn on WL_CPS.*/
31062  ) /* 1 */
31063  {
31064  ((int)(bitmapstruct.element4 |= (1 << 12))); /* 1 */
31065  {
31066  PLIB_PORTS_PinSet ( PORTS_ID_0 , PORT_CHANNEL_G , PORTS_BIT_POS_13 ) ;/* Turn WL_CPS on.*/
31067  ( void ) memset ( WL_CPS.current_array , 0 , 5 ) ;/* Reset the current array values.*/
31068  WL_CPS.max_current = 0U ; /* Reset max current observed when WL_CPS is turned off.*/
31069  Set_Status ( 9 ) ;/* Set status bit 8 to show WL_CPS is on.*/
31070  }
31071  } else ((int)(bitmapstruct.element4 |= (1 << 13))); /* 4 */
31072  CMD.process_complete_flag = true ; /* Set this flag to show we have completed processing the command.*/
31073  Prepare_Return_A ( CMD.command[ 0 ] , 0 , 0 ) ;/* Prepare the protocol A response.*/
31074  CMD.command[ 0 ] = 0x00U ; /* Reset the Command received byte.*/
31075  }
31076  ((int)(bitmapstruct.element4 |= (1 << 14))); /* 16 */
31077  goto l130933 ;
31078  case 0x57U :
31079  ((bitmapstruct.element4 |= ((( 0== 1)||(qqqzzglobflag == 1)) ? ( qqqzzglobflag ^= 1, 1 << 15) : 0)), 1 ); /* 41 */
31080  /* 57h*/
31081  {
31082  CMD.process_complete_flag = true ; /* Set this flag to show we have completed processing the command.*/
31083  Prepare_Return_A ( CMD.command[ 0 ] , 0 , ( uint8_t ) WL_CPS.voltage ) ;/* Prepare the protocol A response.*/
31084  CMD.command[ 0 ] = 0x00U ; /* Reset the Command received byte.*/
31085  }
31086  ((int)(bitmapstruct.element4 |= (1 << 16))); /* 16 */
31087  goto l130933 ;
31088  case 0x58U :
31089  ((bitmapstruct.element4 |= ((( 0== 1)||(qqqzzglobflag == 1)) ? ( qqqzzglobflag ^= 1, 1 << 17) : 0)), 1 ); /* 41 */
31090  /* 58h*/
31091  {
31092  MAN.manual_bias_flag = false ; /* Reset flag to show MAN bias is calculated.*/
31093  if
31094  ( /* 50 */
31095  (
31096 
31097  ( /* 52 */
31098  (
31099  MAN.spi_sent_flag == false
31100  )
31101  ? (bitmapstruct.element4 |= (1 << 18 ), 1)
31102  : (bitmapstruct.element4 |= (1 << 19 ), 0) ) /* 54 */
31103  &&
31104  ( MAN_BIAS.spi_bias_fsk != (
31105  (
31106  ( DRV_HANDLE ) - 1 ) ) )
31107  )
31108  ) /* 1 */
31109  {
31110  ((int)(bitmapstruct.element4 |= (1 << 20))); /* 1 */
31111  {
31112  Calc_Auto_Bias () ; /* Calculate the correct bias and send data to the MAN_BIAS SPI port.*/
31113  MAN.spi_sent_flag = true ; /* Set this flag to show we sent data to the MAN_BIAS SPI port.*/
31114  }
31115  } else ((int)(bitmapstruct.element4 |= (1 << 21))); /* 4 */
31116  if
31117  (
31119  ) /* If the SPI port is through sending data,*/
31120  {
31121  ((int)(bitmapstruct.element4 |= (1 << 22))); /* 1 */
31122  {
31123  MAN.spi_write_complete_flag = false ; /* reset the flag.*/
31124  CMD.process_complete_flag = true ; /* Set this flag to show we have completed processing the command.*/
31125  Prepare_Return_A ( CMD.command[ 0 ] , 0 , 0 ) ;/* Prepare the protocol A response.*/
31126  CMD.command[ 0 ] = 0x00U ; /* Reset the Command received byte.*/
31127  MAN.spi_sent_flag = false ; /* Reset the flag so we can send data.*/
31128  Clear_Status ( 8 ) ;/* Clear status bit 7 to show MAN_BIAS was set automatically.*/
31129  }
31130  } else ((int)(bitmapstruct.element4 |= (1 << 23))); /* 4 */
31131  }
31132  ((int)(bitmapstruct.element4 |= (1 << 24))); /* 16 */
31133  goto l130933 ;
31134  case 0x59U :
31135  ((bitmapstruct.element4 |= ((( 0== 1)||(qqqzzglobflag == 1)) ? ( qqqzzglobflag ^= 1, 1 << 25) : 0)), 1 ); /* 41 */
31136  /* 59h*/
31137  {
31138  MAN.manual_bias_flag = true ; /* Set flag to show MAN bias is set manually.*/
31139  if
31140  ( /* 50 */
31141  (
31142 
31143  ( /* 52 */
31144  (
31145  MAN.spi_sent_flag == false
31146  )
31147  ? (bitmapstruct.element4 |= (1 << 26 ), 1)
31148  : (bitmapstruct.element4 |= (1 << 27 ), 0) ) /* 54 */
31149  &&
31150  ( MAN_BIAS.spi_bias_fsk != (
31151  (
31152  ( DRV_HANDLE ) - 1 ) ) )
31153  )
31154  ) /* 1 */
31155  {
31156  ((int)(bitmapstruct.element4 |= (1 << 28))); /* 1 */
31157  {
31158  Set_Bias ( CMD.command[ 5 ] ) ;/* Set the MAN_bias to the desired value.*/
31159  MAN.spi_sent_flag = true ; /* Set this flag to show we sent data to the MAN_BIAS SPI port.*/
31160  }
31161  } else ((int)(bitmapstruct.element4 |= (1 << 29))); /* 4 */
31162  if
31163  (
31165  ) /* If the SPI port is through sending data,*/
31166  {
31167  ((int)(bitmapstruct.element4 |= (1 << 30))); /* 1 */
31168  {
31169  MAN.spi_write_complete_flag = false ; /* reset the flag.*/
31170  CMD.process_complete_flag = true ; /* Set this flag to show we have completed processing the command.*/
31171  Prepare_Return_A ( CMD.command[ 0 ] , 0 , 0 ) ;/* Prepare the protocol A response.*/
31172  CMD.command[ 0 ] = 0x00U ; /* Reset the Command received byte.*/
31173  MAN.spi_sent_flag = false ; /* Reset the flag so we can send data.*/
31174  Set_Status ( 8 ) ;/* Set status bit 7 to show MAN_BIAS was set manually.*/
31175  }
31176  } else ((int)(bitmapstruct.element4 |= (1 << 31))); /* 4 */
31177  }
31178  ((int)(bitmapstruct.element5 |= (1 << 0))); /* 16 */
31179  goto l130933 ;
31180  case 0x5AU :
31181  ((bitmapstruct.element5 |= ((( 0== 1)||(qqqzzglobflag == 1)) ? ( qqqzzglobflag ^= 1, 1 << 1) : 0)), 1 ); /* 41 */
31182  /* 5Ah*/
31183  {
31184  CMD.process_complete_flag = true ; /* Set this flag to show we have completed processing the command.*/
31185  Prepare_Return_A ( CMD.command[ 0 ] , 0 , ( 0x00FFU & MAN_BIAS.adj[ 0 ] ) ) ;/* Prepare the protocol A response.*/
31186  CMD.command[ 0 ] = 0x00U ; /* Reset the Command received byte.*/
31187  }
31188  ((int)(bitmapstruct.element5 |= (1 << 2))); /* 16 */
31189  goto l130933 ;
31190  case 0x5BU :
31191  ((bitmapstruct.element5 |= ((( 0== 1)||(qqqzzglobflag == 1)) ? ( qqqzzglobflag ^= 1, 1 << 3) : 0)), 1 ); /* 41 */
31192  /* 5Bh*/
31193  {
31194  CMD.process_complete_flag = true ; /* Set this flag to show we have completed processing the command.*/
31195  Prepare_Return_A ( CMD.command[ 0 ] , 0 , APP.RevNumber ) ;/* Prepare the protocol A response.*/
31196  CMD.command[ 0 ] = 0x00U ; /* Reset the Command received byte.*/
31197  }
31198  ((int)(bitmapstruct.element5 |= (1 << 4))); /* 16 */
31199  goto l130933 ;
31200  case 0x5CU :
31201  ((bitmapstruct.element5 |= ((( 0== 1)||(qqqzzglobflag == 1)) ? ( qqqzzglobflag ^= 1, 1 << 5) : 0)), 1 ); /* 41 */
31202  /* 5Ch*/
31203  {
31204  CMD.process_complete_flag = true ; /* Set this flag to show we have completed processing the command.*/
31205  Prepare_Return_A ( CMD.command[ 0 ] , 0 , 0 ) ;/* Prepare the protocol A response.*/
31206  CMD.command[ 0 ] = 0x00U ; /* Reset the Command received byte.*/
31207  }
31208  ((int)(bitmapstruct.element5 |= (1 << 6))); /* 16 */
31209  goto l130933 ;
31210  case 0x5DU :
31211  ((bitmapstruct.element5 |= ((( 0== 1)||(qqqzzglobflag == 1)) ? ( qqqzzglobflag ^= 1, 1 << 7) : 0)), 1 ); /* 41 */
31212  /* 5Dh*/
31213  {
31214  CMD.process_complete_flag = true ; /* Set this flag to show we have completed processing the command.*/
31215  Prepare_Return_A ( CMD.command[ 0 ] , SWITCH.store_buffer[ 1 ] , SWITCH.store_buffer[ 0 ] ) ;/* Prepare the protocol A response.*/
31216  CMD.command[ 0 ] = 0x00U ; /* Reset the Command received byte.*/
31217  }
31218  ((int)(bitmapstruct.element5 |= (1 << 8))); /* 16 */
31219  goto l130933 ;
31220  case 0x5EU :
31221  ((bitmapstruct.element5 |= ((( 0== 1)||(qqqzzglobflag == 1)) ? ( qqqzzglobflag ^= 1, 1 << 9) : 0)), 1 ); /* 41 */
31222  /* 5Eh*/
31223  {
31224  PLIB_PORTS_PinSet ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_14 ) ;/* Close this relay before communications with a PerfSwitch begins.*/
31225  Set_Status ( 11 ) ;/* Set status bit 10 to show OR relay is closed.*/
31226  CMD.process_complete_flag = true ; /* Set this flag to show we have completed processing the command.*/
31227  Prepare_Return_A ( CMD.command[ 0 ] , 0 , 0 ) ;/* Prepare the protocol A response.*/
31228  CMD.command[ 0 ] = 0x00U ; /* Reset the Command received byte.*/
31229  }
31230  ((int)(bitmapstruct.element5 |= (1 << 10))); /* 16 */
31231  goto l130933 ;
31232  case 0x5FU :
31233  ((bitmapstruct.element5 |= ((( 0== 1)||(qqqzzglobflag == 1)) ? ( qqqzzglobflag ^= 1, 1 << 11) : 0)), 1 ); /* 41 */
31234  /* 5Fh*/
31235  {
31236  PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_14 ) ;/* Open this relay when communications with PerfSwitch are complete.*/
31237  Clear_Status ( 11 ) ;/* Clear status bit 10 to show OR relay is open.*/
31238  CMD.process_complete_flag = true ; /* Set this flag to show we have completed processing the command.*/
31239  Prepare_Return_A ( CMD.command[ 0 ] , 0 , 0 ) ;/* Prepare the protocol A response.*/
31240  CMD.command[ 0 ] = 0x00U ; /* Reset the Command received byte.*/
31241  }
31242  ((int)(bitmapstruct.element5 |= (1 << 12))); /* 16 */
31243  goto l130933 ;
31244  case 0x60U :
31245  ((bitmapstruct.element5 |= ((( 0== 1)||(qqqzzglobflag == 1)) ? ( qqqzzglobflag ^= 1, 1 << 13) : 0)), 1 ); /* 41 */
31246  /* 60h*/
31247  { /* Used for portable SPS only.*/
31248  CMD.process_complete_flag = true ; /* Set this flag to show we have completed processing the command.*/
31249  Prepare_Return_A ( CMD.command[ 0 ] , 0 , 0 ) ;/* Prepare the protocol A response.*/
31250  CMD.command[ 0 ] = 0x00U ; /* Reset the Command received byte.*/
31251  }
31252  ((int)(bitmapstruct.element5 |= (1 << 14))); /* 16 */
31253  goto l130933 ;
31254  case 0x61U :
31255  ((bitmapstruct.element5 |= ((( 0== 1)||(qqqzzglobflag == 1)) ? ( qqqzzglobflag ^= 1, 1 << 15) : 0)), 1 ); /* 41 */
31256  /* 61h*/
31257  { /* Used for portable SPS only.*/
31258  CMD.process_complete_flag = true ; /* Set this flag to show we have completed processing the command.*/
31259  Prepare_Return_A ( CMD.command[ 0 ] , 0 , 0 ) ;/* Prepare the protocol A response.*/
31260  CMD.command[ 0 ] = 0x00U ; /* Reset the Command received byte.*/
31261  }
31262  ((int)(bitmapstruct.element5 |= (1 << 16))); /* 16 */
31263  goto l130933 ;
31264  case 0x62U :
31265  ((bitmapstruct.element5 |= ((( 0== 1)||(qqqzzglobflag == 1)) ? ( qqqzzglobflag ^= 1, 1 << 17) : 0)), 1 ); /* 41 */
31266  /* 62h*/
31267  {
31268  CMD.process_complete_flag = true ; /* Set this flag to show we have completed processing the command.*/
31269  if
31270  ( /* 50 */
31271  (
31272 
31273  ( /* 51 */
31274  (
31276  )
31277  ? (bitmapstruct.element5 |= (1 << 19 ), 1)
31278  : (bitmapstruct.element5 |= (1 << 18 ), 0) ) /* 54 */
31279  ||
31281  ) /* If we are in ARM_CF or AUTO_ARM_CF mode,*/
31282  ) /* 1 */
31283  {
31284  ((int)(bitmapstruct.element5 |= (1 << 20))); /* 1 */
31285  {
31286  Prepare_Return_A ( CMD.command[ 0 ] , WL_SPS.voltage , CF.current ) ;/* return the SPS voltage and the CF current.*/
31287  }
31288  ((int)(bitmapstruct.element5 |= (1 << 21))); /* 3 */
31289  }
31290  else
31291  {
31292  ((int)(bitmapstruct.element5 |= (1 << 22))); /* 2 */
31293  {
31294  Prepare_Return_A ( CMD.command[ 0 ] , WL_SPS.voltage , WL_SPS.current ) ;/* return the SPS voltage and SPS current.*/
31295  }
31296  }
31297  CMD.command[ 0 ] = 0x00U ; /* Reset the Command received byte.*/
31298  Clear_Status ( 3 ) ;/* Clear status bit 2 to clear the overvoltage bit.*/
31299  }
31300  ((int)(bitmapstruct.element5 |= (1 << 23))); /* 16 */
31301  goto l130933 ;
31302  case 0x63U :
31303  ((bitmapstruct.element5 |= ((( 0== 1)||(qqqzzglobflag == 1)) ? ( qqqzzglobflag ^= 1, 1 << 24) : 0)), 1 ); /* 41 */
31304  /* 63h*/
31305  {
31306  CMD.process_complete_flag = true ; /* Set this flag to show we have completed processing the command.*/
31307  Prepare_Return_A ( CMD.command[ 0 ] , WL_CPS.voltage , WL_CPS.current ) ;/* Prepare the protocol A response.*/
31308  CMD.command[ 0 ] = 0x00U ; /* Reset the Command received byte.*/
31309  }
31310  ((int)(bitmapstruct.element5 |= (1 << 25))); /* 16 */
31311  goto l130933 ;
31312  case 0x64U :
31313  ((bitmapstruct.element5 |= ((( 0== 1)||(qqqzzglobflag == 1)) ? ( qqqzzglobflag ^= 1, 1 << 26) : 0)), 1 ); /* 41 */
31314  /* 64h*/
31315  {
31316  CMD.process_complete_flag = true ; /* Set this flag to show we have completed processing the command.*/
31317  Prepare_Return_A ( CMD.command[ 0 ] , 0 , 0 ) ;/* Prepare the protocol A response.*/
31318  CMD.command[ 0 ] = 0x00U ; /* Reset the Command received byte.*/
31319  }
31320  ((int)(bitmapstruct.element5 |= (1 << 27))); /* 16 */
31321  goto l130933 ;
31322  case 0x65U :
31323  ((bitmapstruct.element5 |= ((( 0== 1)||(qqqzzglobflag == 1)) ? ( qqqzzglobflag ^= 1, 1 << 28) : 0)), 1 ); /* 41 */
31324  /* 65h*/
31325  {
31326  CMD.process_complete_flag = true ; /* Set this flag to show we have completed processing the command.*/
31327  Prepare_Return_A ( CMD.command[ 0 ] , 0 , 0 ) ;/* Prepare the protocol A response.*/
31328  CMD.command[ 0 ] = 0x00U ; /* Reset the Command received byte.*/
31329  }
31330  ((int)(bitmapstruct.element5 |= (1 << 29))); /* 16 */
31331  goto l130933 ;
31332  case 0x66U :
31333  ((bitmapstruct.element5 |= ((( 0== 1)||(qqqzzglobflag == 1)) ? ( qqqzzglobflag ^= 1, 1 << 30) : 0)), 1 ); /* 41 */
31334  /* 66h*/
31335  { /* Used for portable SPS only.*/
31336  CMD.process_complete_flag = true ; /* Set this flag to show we have completed processing the command.*/
31337  Prepare_Return_A ( CMD.command[ 0 ] , 0 , 0 ) ;/* Prepare the protocol A response.*/
31338  CMD.command[ 0 ] = 0x00U ; /* Reset the Command received byte.*/
31339  }
31340  ((int)(bitmapstruct.element5 |= (1 << 31))); /* 16 */
31341  goto l130933 ;
31342  case 0x67U :
31343  ((bitmapstruct.element6 |= ((( 0== 1)||(qqqzzglobflag == 1)) ? ( qqqzzglobflag ^= 1, 1 << 0) : 0)), 1 ); /* 41 */
31344  /* 67h*/
31345  { /* Used for portable SPS only.*/
31346  CMD.process_complete_flag = true ; /* Set this flag to show we have completed processing the command.*/
31347  Prepare_Return_A ( CMD.command[ 0 ] , 0 , 0 ) ;/* Prepare the protocol A response.*/
31348  CMD.command[ 0 ] = 0x00U ; /* Reset the Command received byte.*/
31349  }
31350  ((int)(bitmapstruct.element6 |= (1 << 1))); /* 16 */
31351  goto l130933 ;
31352  case 0x68U :
31353  ((bitmapstruct.element6 |= ((( 0== 1)||(qqqzzglobflag == 1)) ? ( qqqzzglobflag ^= 1, 1 << 2) : 0)), 1 ); /* 41 */
31354  /* 68h*/
31355  {
31356  CMD.process_complete_flag = true ; /* Set this flag to show we have completed processing the command.*/
31357  Prepare_Return_A ( CMD.command[ 0 ] , 0 , 0 ) ;/* Prepare the protocol A response.*/
31358  CMD.command[ 0 ] = 0x00U ; /* Reset the Command received byte.*/
31359  }
31360  ((int)(bitmapstruct.element6 |= (1 << 3))); /* 16 */
31361  goto l130933 ;
31362  case 0x69U :
31363  ((bitmapstruct.element6 |= ((( 0== 1)||(qqqzzglobflag == 1)) ? ( qqqzzglobflag ^= 1, 1 << 4) : 0)), 1 ); /* 41 */
31364  /* 69h*/
31365  {
31366  CMD.process_complete_flag = true ; /* Set this flag to show we have completed processing the command.*/
31367  Prepare_Return_A ( CMD.command[ 0 ] , 0 , 0 ) ;/* Prepare the protocol A response.*/
31368  CMD.command[ 0 ] = 0x00U ; /* Reset the Command received byte.*/
31369  }
31370  ((int)(bitmapstruct.element6 |= (1 << 5))); /* 16 */
31371  goto l130933 ;
31372  case 0x6AU :
31373  ((bitmapstruct.element6 |= ((( 0== 1)||(qqqzzglobflag == 1)) ? ( qqqzzglobflag ^= 1, 1 << 6) : 0)), 1 ); /* 41 */
31374  /* 6Ah*/
31375  {
31376  CMD.process_complete_flag = true ; /* Set this flag to show we have completed processing the command.*/
31377  Prepare_Return_A ( CMD.command[ 0 ] , 0 , 0 ) ;/* Prepare the protocol A response.*/
31378  CMD.command[ 0 ] = 0x00U ; /* Reset the Command received byte.*/
31379  }
31380  ((int)(bitmapstruct.element6 |= (1 << 7))); /* 16 */
31381  goto l130933 ;
31382  case 0x6BU :
31383  ((bitmapstruct.element6 |= ((( 0== 1)||(qqqzzglobflag == 1)) ? ( qqqzzglobflag ^= 1, 1 << 8) : 0)), 1 ); /* 41 */
31384  /* 6Bh*/
31385  {
31386  CMD.process_complete_flag = true ; /* Set this flag to show we have completed processing the command.*/
31387  Prepare_Return_A ( CMD.command[ 0 ] , 0 , 0 ) ;/* Prepare the protocol A response.*/
31388  CMD.command[ 0 ] = 0x00U ; /* Reset the Command received byte.*/
31389  }
31390  ((int)(bitmapstruct.element6 |= (1 << 9))); /* 16 */
31391  goto l130933 ;
31392  default :
31393  ((bitmapstruct.element6 |= ((( 0== 1)||(qqqzzglobflag == 1)) ? ( qqqzzglobflag ^= 1, 1 << 10) : 0)), 1 ); /* 41 */
31394  {
31395  CMD.process_complete_flag = true ; /* Set this flag to show we have completed processing the command.*/
31396  Prepare_Return_A ( CMD.command[ 0 ] , 0 , 0 ) ;/* Prepare the protocol A response.*/
31397  CMD.command[ 0 ] = 0x00U ; /* Reset the Command received byte.*/
31398  }
31399  ((int)(bitmapstruct.element6 |= (1 << 11))); /* 16 */
31400  goto l130933 ;
31401  }
31402 l130933 :
31403  ; /* 18 */
31404  ((int)(bitmapstruct.element6 |= (1 << 12))); /* 30 */
31405  commands_65zqendz ( 205 ) ; /* 30 */
31406  }
31407 /*!*************************************************************************************
31408  Function:
31409  static void Execute_Protocol_B (void)
31410  Summary:
31411  Function to execute a protocol B command.
31412  Remarks:
31413  Refer to the commands.h interface header for function usage details.
31414  */
31415 
31416 static void
31418  {
31419  int izzqqzz=((int)(bitmapstruct.element6 |= (1 << 13))); /* 37 */
31420  uint8_t
31421  ident ; /* PerfSwitch StateID.*/
31422  uint8_t
31423  b_cmd ; /* Command to execute.*/
31424  ident = CMD.command[ 4 ] & 0x07U ; /* We need the lower 3 bits of Frame 4.*/
31425  b_cmd = CMD.command[ 0 ] ; /* Frame 0 is the Command byte.*/
31426  switch (
31427  ( ( int )( /* 29 */
31428  b_cmd
31429  ))*
31430  ((bitmapstruct.element6 |= ((( 1== 1)||(qqqzzglobflag == 1)) ? ( qqqzzglobflag ^= 1, 1 << 14) : 0)), 1 ) /* 19 */
31431  )
31432  {
31433  case 0xB0U :
31434  ((bitmapstruct.element6 |= ((( 0== 1)||(qqqzzglobflag == 1)) ? ( qqqzzglobflag ^= 1, 1 << 15) : 0)), 1 ); /* 41 */
31435  /* Wait here for next command to execute.*/
31436  {
31437  /*Comment.*/
31438  }
31439  ((int)(bitmapstruct.element6 |= (1 << 16))); /* 16 */
31440  goto l131244 ;
31441  case 0x80U :
31442  ((bitmapstruct.element6 |= ((( 0== 1)||(qqqzzglobflag == 1)) ? ( qqqzzglobflag ^= 1, 1 << 17) : 0)), 1 ); /* 41 */
31443  /* 0x80. Move PerfSwitch from State 0 to State 1 to initiate comm.*/
31444  {
31445  ident = 0x04 ;
31446  Prepare_Dwn_Msg ( ident , b_cmd , 4 ) ;/* Prepare the data elements for the FSK transmission.*/
31447  DWNMSG.xmit_ready_flag = 0x01 ; /* Flag to show FSK message is ready to send to PerfSwitch.*/
31448  CMD.command[ 0 ] = 0xB0U ; /* Move on to wait for the next command to execute.*/
31449  }
31450  ((int)(bitmapstruct.element6 |= (1 << 18))); /* 16 */
31451  goto l131244 ;
31452  case 0x81U :
31453  ((bitmapstruct.element6 |= ((( 0== 1)||(qqqzzglobflag == 1)) ? ( qqqzzglobflag ^= 1, 1 << 19) : 0)), 1 ); /* 41 */
31454  /* 0x81. Move PerfSwitch from State 1 to State 2 (hibernate).*/
31455  {
31456  ident = ident | 0x08U ;/* OR in a One for a Long message command.*/
31457  Prepare_Dwn_Msg ( ident , b_cmd , 20 ) ;/* Prepare the data elements for the FSK transmission.*/
31458  DWNMSG.xmit_ready_flag = 0x01 ; /* Flag to show FSK message is ready to send to PerfSwitch.*/
31459  CMD.command[ 0 ] = 0xB0U ; /* Move on to wait for the next command to execute.*/
31460  }
31461  ((int)(bitmapstruct.element6 |= (1 << 20))); /* 16 */
31462  goto l131244 ;
31463  case 0x82U :
31464  ((bitmapstruct.element6 |= ((( 0== 1)||(qqqzzglobflag == 1)) ? ( qqqzzglobflag ^= 1, 1 << 21) : 0)), 1 ); /* 41 */
31465  /* 0x82. Move PerfSwitch from State 1 to State 3 (armed).*/
31466  {
31467  ident = ident | 0x08U ; /* OR in a One for a Long message command.*/
31468  Prepare_Dwn_Msg ( ident , b_cmd , 20 ) ;/* Prepare the data elements for the FSK transmission.*/
31469  DWNMSG.xmit_ready_flag = 0x01 ; /* Flag to show FSK message is ready to send to PerfSwitch.*/
31470  CMD.command[ 0 ] = 0xB0U ; /* Move on to wait for the next command to execute.*/
31471  }
31472  ((int)(bitmapstruct.element6 |= (1 << 22))); /* 16 */
31473  goto l131244 ;
31474  case 0x83U :
31475  ((bitmapstruct.element6 |= ((( 0== 1)||(qqqzzglobflag == 1)) ? ( qqqzzglobflag ^= 1, 1 << 23) : 0)), 1 ); /* 41 */
31476  /* 0x83. Safety Sub command wire-line FET 1 on.*/
31477  {
31478  ident = ident | 0x08U ; /* OR in a One for a Long message command.*/
31479  Prepare_Dwn_Msg ( ident , b_cmd , 20 ) ;/* Prepare the data elements for the FSK transmission.*/
31480  DWNMSG.xmit_ready_flag = 0x01 ; /* Flag to show FSK message is ready to send to SafetySub.*/
31481  CMD.command[ 0 ] = 0xB0U ; /* Move on to wait for the next command to execute.*/
31482  }
31483  ((int)(bitmapstruct.element6 |= (1 << 24))); /* 16 */
31484  goto l131244 ;
31485  case 0x84U :
31486  ((bitmapstruct.element6 |= ((( 0== 1)||(qqqzzglobflag == 1)) ? ( qqqzzglobflag ^= 1, 1 << 25) : 0)), 1 ); /* 41 */
31487  /* 0x84. Return PerfSwitch status. Use in PerfSwitch State 1 only.*/
31488  {
31489  ident = ident | 0x08U ;/* OR in a One for a Long message command.*/
31490  Prepare_Dwn_Msg ( ident , b_cmd , 20 ) ;/* Prepare the data elements for the FSK transmission.*/
31491  DWNMSG.xmit_ready_flag = 0x01 ; /* Flag to show FSK message is ready to send to PerfSwitch.*/
31492  CMD.command[ 0 ] = 0xB0U ; /* Move on to wait for the next command to execute.*/
31493  }
31494  ((int)(bitmapstruct.element6 |= (1 << 26))); /* 16 */
31495  goto l131244 ;
31496  case 0x85U :
31497  ((bitmapstruct.element6 |= ((( 0== 1)||(qqqzzglobflag == 1)) ? ( qqqzzglobflag ^= 1, 1 << 27) : 0)), 1 ); /* 41 */
31498  /* 0x85. Safety Sub command wire-line FET 1 off.*/
31499  {
31500  ident = ident | 0x08U ; /* OR in a One for a Long message command.*/
31501  Prepare_Dwn_Msg ( ident , b_cmd , 20 ) ;/* Prepare the data elements for the FSK transmission.*/
31502  DWNMSG.xmit_ready_flag = 0x01 ; /* Flag to show FSK message is ready to send to SafetySub.*/
31503  CMD.command[ 0 ] = 0xB0U ; /* Move on to wait for the next command to execute.*/
31504  }
31505  ((int)(bitmapstruct.element6 |= (1 << 28))); /* 16 */
31506  goto l131244 ;
31507  case 0x86U :
31508  ((bitmapstruct.element6 |= ((( 0== 1)||(qqqzzglobflag == 1)) ? ( qqqzzglobflag ^= 1, 1 << 29) : 0)), 1 ); /* 41 */
31509  /* 0x86. Safety Sub command wire-line FET 2 on.*/
31510  {
31511  ident = ident | 0x08U ; /* OR in a One for a Long message command.*/
31512  Prepare_Dwn_Msg ( ident , b_cmd , 20 ) ;/* Prepare the data elements for the FSK transmission.*/
31513  DWNMSG.xmit_ready_flag = 0x01 ; /* Flag to show FSK message is ready to send to SafetySub.*/
31514  CMD.command[ 0 ] = 0xB0U ; /* Move on to wait for the next command to execute.*/
31515  }
31516  ((int)(bitmapstruct.element6 |= (1 << 30))); /* 16 */
31517  goto l131244 ;
31518  case 0x87U :
31519  ((bitmapstruct.element6 |= ((( 0== 1)||(qqqzzglobflag == 1)) ? ( qqqzzglobflag ^= 1, 1 << 31) : 0)), 1 ); /* 41 */
31520  /* 0x87. Safety Sub command wire-line FET 2 off.*/
31521  {
31522  ident = ident | 0x08U ; /* OR in a One for a Long message command.*/
31523  Prepare_Dwn_Msg ( ident , b_cmd , 20 ) ;/* Prepare the data elements for the FSK transmission.*/
31524  DWNMSG.xmit_ready_flag = 0x01 ; /* Flag to show FSK message is ready to send to SafetySub.*/
31525  CMD.command[ 0 ] = 0xB0U ; /* Move on to wait for the next command to execute.*/
31526  }
31527  ((int)(bitmapstruct.element7 |= (1 << 0))); /* 16 */
31528  goto l131244 ;
31529  case 0x88U :
31530  ((bitmapstruct.element7 |= ((( 0== 1)||(qqqzzglobflag == 1)) ? ( qqqzzglobflag ^= 1, 1 << 1) : 0)), 1 ); /* 41 */
31531  /* 0x88. Use in PerfSwitch State 3 only.*/
31532  {
31533  ident = ident | 0x08U ; /* OR in a One for a Long message command.*/
31534  Prepare_Dwn_Msg ( ident , b_cmd , 20 ) ;/* Prepare the data elements for the FSK transmission.*/
31535  DWNMSG.xmit_ready_flag = 0x01 ; /* Flag to show FSK message is ready to send to PerfSwitch.*/
31536  CMD.command[ 0 ] = 0xB0U ; /* Move on to wait for the next command to execute.*/
31537  }
31538  ((int)(bitmapstruct.element7 |= (1 << 2))); /* 16 */
31539  goto l131244 ;
31540  case 0x89U :
31541  ((bitmapstruct.element7 |= ((( 0== 1)||(qqqzzglobflag == 1)) ? ( qqqzzglobflag ^= 1, 1 << 3) : 0)), 1 ); /* 41 */
31542  /* 0x89. Use in PerfSwitch State 3 only.*/
31543  {
31544  ident = ident | 0x08U ; /* OR in a One for a Long message command.*/
31545  Prepare_Dwn_Msg ( ident , b_cmd , 20 ) ;/* Prepare the data elements for the FSK transmission.*/
31546  DWNMSG.xmit_ready_flag = 0x01 ; /* Flag to show FSK message is ready to send to PerfSwitch.*/
31547  CMD.command[ 0 ] = 0xB0U ; /* Move on to wait for the next command to execute.*/
31548  }
31549  ((int)(bitmapstruct.element7 |= (1 << 4))); /* 16 */
31550  goto l131244 ;
31551  case 0x8AU :
31552  ((bitmapstruct.element7 |= ((( 0== 1)||(qqqzzglobflag == 1)) ? ( qqqzzglobflag ^= 1, 1 << 5) : 0)), 1 ); /* 41 */
31553  /* 0x8A. Return PerfSwtich firmware revision. Use in PerfSwitch State 1 only.*/
31554  {
31555  CMD.sw_status_bit_check = false ; /* Ignore status bits from PerfSwitch.*/
31556  ident = ident | 0x08U ;/* OR in a One for a Long message command.*/
31557  Prepare_Dwn_Msg ( ident , b_cmd , 20 ) ;/* Prepare the data elements for the FSK transmission.*/
31558  DWNMSG.xmit_ready_flag = 0x01 ; /* Flag to show FSK message is ready to send to PerfSwitch.*/
31559  CMD.command[ 0 ] = 0xB0U ; /* Move on to wait for the next command to execute.*/
31560  }
31561  ((int)(bitmapstruct.element7 |= (1 << 6))); /* 16 */
31562  goto l131244 ;
31563  case 0x8BU :
31564  ((bitmapstruct.element7 |= ((( 0== 1)||(qqqzzglobflag == 1)) ? ( qqqzzglobflag ^= 1, 1 << 7) : 0)), 1 ); /* 41 */
31565  /* 0x8B. Safety Sub command Get temperature.*/
31566  {
31567  CMD.sw_status_bit_check = false ; /* Ignore status bits from PerfSwitch.*/
31568  ident = ident | 0x08U ; /* OR in a One for a Long message command.*/
31569  Prepare_Dwn_Msg ( ident , b_cmd , 20 ) ;/* Prepare the data elements for the FSK transmission.*/
31570  DWNMSG.xmit_ready_flag = 0x01 ; /* Flag to show FSK message is ready to send to SafetySub.*/
31571  CMD.command[ 0 ] = 0xB0U ; /* Move on to wait for the next command to execute.*/
31572  }
31573  ((int)(bitmapstruct.element7 |= (1 << 8))); /* 16 */
31574  goto l131244 ;
31575  case 0x8DU :
31576  ((bitmapstruct.element7 |= ((( 0== 1)||(qqqzzglobflag == 1)) ? ( qqqzzglobflag ^= 1, 1 << 9) : 0)), 1 ); /* 41 */
31577  /* 0x8D.*/
31578  {
31579  CMD.sw_status_bit_check = false ; /* Ignore status bits from PerfSwitch.*/
31580  ident = ident | 0x08U ; /* OR in a One for a Long message command.*/
31581  Prepare_Dwn_Msg ( ident , b_cmd , 20 ) ;/* Prepare the data elements for the FSK transmission.*/
31582  DWNMSG.xmit_ready_flag = 0x01 ; /* Flag to show FSK message is ready to send to PerfSwitch.*/
31583  CMD.command[ 0 ] = 0xB0U ; /* Move on to wait for the next command to execute.*/
31584  }
31585  ((int)(bitmapstruct.element7 |= (1 << 10))); /* 16 */
31586  goto l131244 ;
31587  case 0x8EU :
31588  ((bitmapstruct.element7 |= ((( 0== 1)||(qqqzzglobflag == 1)) ? ( qqqzzglobflag ^= 1, 1 << 11) : 0)), 1 ); /* 41 */
31589  /* 0x8E. Safety Sub command wire-line FET 3 on.*/
31590  {
31591  ident = ident | 0x08U ; /* OR in a One for a Long message command.*/
31592  Prepare_Dwn_Msg ( ident , b_cmd , 20 ) ;/* Prepare the data elements for the FSK transmission.*/
31593  DWNMSG.xmit_ready_flag = 0x01 ; /* Flag to show FSK message is ready to send to SafetySub.*/
31594  CMD.command[ 0 ] = 0xB0U ; /* Move on to wait for the next command to execute.*/
31595  }
31596  ((int)(bitmapstruct.element7 |= (1 << 12))); /* 16 */
31597  goto l131244 ;
31598  case 0x8FU :
31599  ((bitmapstruct.element7 |= ((( 0== 1)||(qqqzzglobflag == 1)) ? ( qqqzzglobflag ^= 1, 1 << 13) : 0)), 1 ); /* 41 */
31600  /* 0x8F. Safety Sub command wire-line FET 3 off.*/
31601  {
31602  ident = ident | 0x08U ; /* OR in a One for a Long message command.*/
31603  Prepare_Dwn_Msg ( ident , b_cmd , 20 ) ;/* Prepare the data elements for the FSK transmission.*/
31604  DWNMSG.xmit_ready_flag = 0x01 ; /* Flag to show FSK message is ready to send to SafetySub.*/
31605  CMD.command[ 0 ] = 0xB0U ; /* Move on to wait for the next command to execute.*/
31606  }
31607  ((int)(bitmapstruct.element7 |= (1 << 14))); /* 16 */
31608  goto l131244 ;
31609  case 0x90U :
31610  ((bitmapstruct.element7 |= ((( 0== 1)||(qqqzzglobflag == 1)) ? ( qqqzzglobflag ^= 1, 1 << 15) : 0)), 1 ); /* 41 */
31611  /* 0x90. Safety Sub command wire-line FET 4 on.*/
31612  {
31613  ident = ident | 0x08U ; /* OR in a One for a Long message command.*/
31614  Prepare_Dwn_Msg ( ident , b_cmd , 20 ) ;/* Prepare the data elements for the FSK transmission.*/
31615  DWNMSG.xmit_ready_flag = 0x01 ; /* Flag to show FSK message is ready to send to SafetySub.*/
31616  CMD.command[ 0 ] = 0xB0U ; /* Move on to wait for the next command to execute.*/
31617  }
31618  ((int)(bitmapstruct.element7 |= (1 << 16))); /* 16 */
31619  goto l131244 ;
31620  case 0x91U :
31621  ((bitmapstruct.element7 |= ((( 0== 1)||(qqqzzglobflag == 1)) ? ( qqqzzglobflag ^= 1, 1 << 17) : 0)), 1 ); /* 41 */
31622  /* 0x91. Safety Sub command wire-line FET 4 off.*/
31623  {
31624  ident = ident | 0x08U ; /* OR in a One for a Long message command.*/
31625  Prepare_Dwn_Msg ( ident , b_cmd , 20 ) ;/* Prepare the data elements for the FSK transmission.*/
31626  DWNMSG.xmit_ready_flag = 0x01 ; /* Flag to show FSK message is ready to send to SafetySub.*/
31627  CMD.command[ 0 ] = 0xB0U ; /* Move on to wait for the next command to execute.*/
31628  }
31629  ((int)(bitmapstruct.element7 |= (1 << 18))); /* 16 */
31630  goto l131244 ;
31631  case 0x92U :
31632  ((bitmapstruct.element7 |= ((( 0== 1)||(qqqzzglobflag == 1)) ? ( qqqzzglobflag ^= 1, 1 << 19) : 0)), 1 ); /* 41 */
31633  /* 0x92. Open Motorized Release Tool.*/
31634  {
31635  ident = ident | 0x08U ; /* OR in a One for a Long message command.*/
31636  Prepare_Dwn_Msg ( ident , b_cmd , 20 ) ;/* Prepare the data elements for the FSK transmission.*/
31637  DWNMSG.xmit_ready_flag = 0x01 ; /* Flag to show FSK message is ready to send to SafetySub.*/
31638  CMD.command[ 0 ] = 0xB0U ; /* Move on to wait for the next command to execute.*/
31639  }
31640  ((int)(bitmapstruct.element7 |= (1 << 20))); /* 16 */
31641  goto l131244 ;
31642  case 0x93U :
31643  ((bitmapstruct.element7 |= ((( 0== 1)||(qqqzzglobflag == 1)) ? ( qqqzzglobflag ^= 1, 1 << 21) : 0)), 1 ); /* 41 */
31644  /* 0x93. Close Motorized Release Tool.*/
31645  {
31646  ident = ident | 0x08U ; /* OR in a One for a Long message command.*/
31647  Prepare_Dwn_Msg ( ident , b_cmd , 20 ) ;/* Prepare the data elements for the FSK transmission.*/
31648  DWNMSG.xmit_ready_flag = 0x01 ; /* Flag to show FSK message is ready to send to SafetySub.*/
31649  CMD.command[ 0 ] = 0xB0U ; /* Move on to wait for the next command to execute.*/
31650  }
31651  ((int)(bitmapstruct.element7 |= (1 << 22))); /* 16 */
31652  goto l131244 ;
31653  case 0x95U :
31654  ((bitmapstruct.element7 |= ((( 0== 1)||(qqqzzglobflag == 1)) ? ( qqqzzglobflag ^= 1, 1 << 23) : 0)), 1 ); /* 41 */
31655  /* 0x95.*/
31656  {
31657  CMD.sw_status_bit_check = false ; /* Ignore status bits from PerfSwitch.*/
31658  ident = ident | 0x08U ; /* OR in a One for a Long message command.*/
31659  Prepare_Dwn_Msg ( ident , b_cmd , 20 ) ;/* Prepare the data elements for the FSK transmission.*/
31660  DWNMSG.xmit_ready_flag = 0x01 ; /* Flag to show FSK message is ready to send to PerfSwitch.*/
31661  CMD.command[ 0 ] = 0xB0U ; /* Move on to wait for the next command to execute.*/
31662  }
31663  ((int)(bitmapstruct.element7 |= (1 << 24))); /* 16 */
31664  goto l131244 ;
31665  case 0x96U :
31666  ((bitmapstruct.element7 |= ((( 0== 1)||(qqqzzglobflag == 1)) ? ( qqqzzglobflag ^= 1, 1 << 25) : 0)), 1 ); /* 41 */
31667  /* 0x96.*/
31668  {
31669  CMD.sw_status_bit_check = false ; /* Ignore status bits from PerfSwitch.*/
31670  ident = ident | 0x08U ; /* OR in a One for a Long message command.*/
31671  Prepare_Dwn_Msg ( ident , b_cmd , 20 ) ;/* Prepare the data elements for the FSK transmission.*/
31672  DWNMSG.xmit_ready_flag = 0x01 ; /* Flag to show FSK message is ready to send to PerfSwitch.*/
31673  CMD.command[ 0 ] = 0xB0U ; /* Move on to wait for the next command to execute.*/
31674  }
31675  ((int)(bitmapstruct.element7 |= (1 << 26))); /* 16 */
31676  goto l131244 ;
31677  case 0x97U :
31678  ((bitmapstruct.element7 |= ((( 0== 1)||(qqqzzglobflag == 1)) ? ( qqqzzglobflag ^= 1, 1 << 27) : 0)), 1 ); /* 41 */
31679  /* 0x97.*/
31680  {
31681  ident = ident | 0x08U ; /* OR in a One for a Long message command.*/
31682  Prepare_Dwn_Msg ( ident , b_cmd , 20 ) ;/* Prepare the data elements for the FSK transmission.*/
31683  DWNMSG.xmit_ready_flag = 0x01 ; /* Flag to show FSK message is ready to send to PerfSwitch.*/
31684  CMD.command[ 0 ] = 0xB0U ; /* Move on to wait for the next command to execute.*/
31685  }
31686  ((int)(bitmapstruct.element7 |= (1 << 28))); /* 16 */
31687  goto l131244 ;
31688  case 0x98U :
31689  ((bitmapstruct.element7 |= ((( 0== 1)||(qqqzzglobflag == 1)) ? ( qqqzzglobflag ^= 1, 1 << 29) : 0)), 1 ); /* 41 */
31690  /* 0x98.*/
31691  {
31692  CMD.sw_status_bit_check = false ; /* Ignore status bits from PerfSwitch.*/
31693  ident = ident | 0x08U ; /* OR in a One for a Long message command.*/
31694  Prepare_Dwn_Msg ( ident , b_cmd , 20 ) ;/* Prepare the data elements for the FSK transmission.*/
31695  DWNMSG.xmit_ready_flag = 0x01 ; /* Flag to show FSK message is ready to send to PerfSwitch.*/
31696  CMD.command[ 0 ] = 0xB0U ; /* Move on to wait for the next command to execute.*/
31697  }
31698  ((int)(bitmapstruct.element7 |= (1 << 30))); /* 16 */
31699  goto l131244 ;
31700  case 0x99U :
31701  ((bitmapstruct.element7 |= ((( 0== 1)||(qqqzzglobflag == 1)) ? ( qqqzzglobflag ^= 1, 1 << 31) : 0)), 1 ); /* 41 */
31702  /* 0x99.*/
31703  {
31704  CMD.sw_status_bit_check = false ; /* Ignore status bits from PerfSwitch.*/
31705  ident = ident | 0x08U ; /* OR in a One for a Long message command.*/
31706  Prepare_Dwn_Msg ( ident , b_cmd , 20 ) ;/* Prepare the data elements for the FSK transmission.*/
31707  DWNMSG.xmit_ready_flag = 0x01 ; /* Flag to show FSK message is ready to send to PerfSwitch.*/
31708  CMD.command[ 0 ] = 0xB0U ; /* Move on to wait for the next command to execute.*/
31709  }
31710  ((int)(bitmapstruct.element8 |= (1 << 0))); /* 16 */
31711  goto l131244 ;
31712  case 0x9AU :
31713  ((bitmapstruct.element8 |= ((( 0== 1)||(qqqzzglobflag == 1)) ? ( qqqzzglobflag ^= 1, 1 << 1) : 0)), 1 ); /* 41 */
31714  /* 0x9A.*/
31715  {
31716  CMD.sw_status_bit_check = false ; /* Ignore status bits from PerfSwitch.*/
31717  ident = ident | 0x08U ; /* OR in a One for a Long message command.*/
31718  Prepare_Dwn_Msg ( ident , b_cmd , 20 ) ;/* Prepare the data elements for the FSK transmission.*/
31719  DWNMSG.xmit_ready_flag = 0x01 ; /* Flag to show FSK message is ready to send to PerfSwitch.*/
31720  CMD.command[ 0 ] = 0xB0U ; /* Move on to wait for the next command to execute.*/
31721  }
31722  ((int)(bitmapstruct.element8 |= (1 << 2))); /* 16 */
31723  goto l131244 ;
31724  case 0x9BU :
31725  ((bitmapstruct.element8 |= ((( 0== 1)||(qqqzzglobflag == 1)) ? ( qqqzzglobflag ^= 1, 1 << 3) : 0)), 1 ); /* 41 */
31726  /* 0x9B.*/
31727  {
31728  CMD.sw_status_bit_check = false ; /* Ignore status bits from PerfSwitch.*/
31729  ident = ident | 0x08U ; /* OR in a One for a Long message command.*/
31730  Prepare_Dwn_Msg ( ident , b_cmd , 20 ) ;/* Prepare the data elements for the FSK transmission.*/
31731  DWNMSG.xmit_ready_flag = 0x01 ; /* Flag to show FSK message is ready to send to PerfSwitch.*/
31732  CMD.command[ 0 ] = 0xB0U ; /* Move on to wait for the next command to execute.*/
31733  }
31734  ((int)(bitmapstruct.element8 |= (1 << 4))); /* 16 */
31735  goto l131244 ;
31736  case 0x9CU :
31737  ((bitmapstruct.element8 |= ((( 0== 1)||(qqqzzglobflag == 1)) ? ( qqqzzglobflag ^= 1, 1 << 5) : 0)), 1 ); /* 41 */
31738  /* 0x9C.*/
31739  {
31740  CMD.sw_status_bit_check = false ; /* Ignore status bits from PerfSwitch.*/
31741  ident = ident | 0x08U ; /* OR in a One for a Long message command.*/
31742  Prepare_Dwn_Msg ( ident , b_cmd , 20 ) ;/* Prepare the data elements for the FSK transmission.*/
31743  DWNMSG.xmit_ready_flag = 0x01 ; /* Flag to show FSK message is ready to send to PerfSwitch.*/
31744  CMD.command[ 0 ] = 0xB0U ; /* Move on to wait for the next command to execute.*/
31745  }
31746  ((int)(bitmapstruct.element8 |= (1 << 6))); /* 16 */
31747  goto l131244 ;
31748  case 0x9DU :
31749  ((bitmapstruct.element8 |= ((( 0== 1)||(qqqzzglobflag == 1)) ? ( qqqzzglobflag ^= 1, 1 << 7) : 0)), 1 ); /* 41 */
31750  /* 0x9D.*/
31751  {
31752  CMD.sw_status_bit_check = false ; /* Ignore status bits from PerfSwitch.*/
31753  ident = ident | 0x08U ; /* OR in a One for a Long message command.*/
31754  Prepare_Dwn_Msg ( ident , b_cmd , 20 ) ;/* Prepare the data elements for the FSK transmission.*/
31755  DWNMSG.xmit_ready_flag = 0x01 ; /* Flag to show FSK message is ready to send to PerfSwitch.*/
31756  CMD.command[ 0 ] = 0xB0U ; /* Move on to wait for the next command to execute.*/
31757  }
31758  ((int)(bitmapstruct.element8 |= (1 << 8))); /* 16 */
31759  goto l131244 ;
31760  case 0x9EU :
31761  ((bitmapstruct.element8 |= ((( 0== 1)||(qqqzzglobflag == 1)) ? ( qqqzzglobflag ^= 1, 1 << 9) : 0)), 1 ); /* 41 */
31762  /* 0x9E.*/
31763  {
31764  CMD.sw_status_bit_check = false ; /* Ignore status bits from PerfSwitch.*/
31765  ident = ident | 0x08U ; /* OR in a One for a Long message command.*/
31766  Prepare_Dwn_Msg ( ident , b_cmd , 20 ) ;/* Prepare the data elements for the FSK transmission.*/
31767  DWNMSG.xmit_ready_flag = 0x01 ; /* Flag to show FSK message is ready to send to PerfSwitch.*/
31768  CMD.command[ 0 ] = 0xB0U ; /* Move on to wait for the next command to execute.*/
31769  }
31770  ((int)(bitmapstruct.element8 |= (1 << 10))); /* 16 */
31771  goto l131244 ;
31772  default :
31773  ((bitmapstruct.element8 |= ((( 0== 1)||(qqqzzglobflag == 1)) ? ( qqqzzglobflag ^= 1, 1 << 11) : 0)), 1 ); /* 41 */
31774  {
31775  ident = ident | 0x08U ; /* OR in a One for a Long message command.*/
31776  Prepare_Dwn_Msg ( ident , b_cmd , 20 ) ;/* Prepare the data elements for the FSK transmission.*/
31777  DWNMSG.xmit_ready_flag = 0x01 ; /* Flag to show FSK message is ready to send to PerfSwitch.*/
31778  CMD.command[ 0 ] = 0xB0U ; /* Move on to wait for the next command to execute.*/
31779  }
31780  ((int)(bitmapstruct.element8 |= (1 << 12))); /* 16 */
31781  goto l131244 ;
31782  }
31783 l131244 :
31784  ; /* 18 */
31785  ((int)(bitmapstruct.element8 |= (1 << 13))); /* 30 */
31786  commands_65zqendz ( 270 ) ; /* 30 */
31787  }
31788 /*!*************************************************************************************
31789  Function:
31790  static void Execute_System(void)
31791  Summary:
31792  Function to execute a system command.
31793  Remarks:
31794  Refer to the commands.h interface header for function usage details.
31795  */
31796 
31797 static void
31799  {
31800  int izzqqzz=((int)(bitmapstruct.element8 |= (1 << 14))); /* 37 */
31801  switch (
31802  ( ( int )( /* 29 */
31803  CMD.command[ 0 ]
31804  ))*
31805  ((bitmapstruct.element8 |= ((( 1== 1)||(qqqzzglobflag == 1)) ? ( qqqzzglobflag ^= 1, 1 << 15) : 0)), 1 ) /* 19 */
31806  )
31807  {
31808  case 0x00U :
31809  ((bitmapstruct.element8 |= ((( 0== 1)||(qqqzzglobflag == 1)) ? ( qqqzzglobflag ^= 1, 1 << 16) : 0)), 1 ); /* 41 */
31810  /* No GUI connected. Depth Status Unavailable.*/
31811  DepthStatus = true ;
31812  ((int)(bitmapstruct.element8 |= (1 << 17))); /* 16 */
31813  goto l131288 ;
31814  case 0x01U :
31815  ((bitmapstruct.element8 |= ((( 0== 1)||(qqqzzglobflag == 1)) ? ( qqqzzglobflag ^= 1, 1 << 18) : 0)), 1 ); /* 41 */
31816  /* Hunting SPS Data Supply GUI connected.*/
31817  DepthStatus = true ;
31818  /* AudioOut( ( Command[ 2 ] )& 0x01 )*/
31819  ((int)(bitmapstruct.element8 |= (1 << 19))); /* 16 */
31820  goto l131288 ;
31821  case 0x02U :
31822  ((bitmapstruct.element8 |= ((( 0== 1)||(qqqzzglobflag == 1)) ? ( qqqzzglobflag ^= 1, 1 << 20) : 0)), 1 ); /* 41 */
31823  /* Toggle LEDs command. */
31824 // HEARTBT =!HEARTBT;
31825 // NVMErasePage((void *)NVM_PROGRAM_PAGE);
31826 // NVMWriteWord((void*)(NVM_PROGRAM_PAGE ), ( unsigned int )spsIPresently);
31827 // spsIoffset = spsIPresently;
31828 // WL_SPS.I_OFFSET = WL_SPS.I_LATEST;
31830  ((int)(bitmapstruct.element8 |= (1 << 21))); /* 16 */
31831  goto l131288 ;
31832  case 0xA5U :
31833  ((bitmapstruct.element8 |= ((( 0== 1)||(qqqzzglobflag == 1)) ? ( qqqzzglobflag ^= 1, 1 << 22) : 0)), 1 ); /* 41 */
31834  DepthStatus = ( bool ) ( CMD.command[ 1 ] & 0x01U ) ;
31835  /* AudioOut( ( Command[ 1 ] >> 1 )& 0x01 )*/
31836  ((int)(bitmapstruct.element8 |= (1 << 23))); /* 16 */
31837  goto l131288 ;
31838  default :
31839  ((bitmapstruct.element8 |= ((( 0== 1)||(qqqzzglobflag == 1)) ? ( qqqzzglobflag ^= 1, 1 << 24) : 0)), 1 ); /* 41 */
31840  {
31841  }
31842  ((int)(bitmapstruct.element8 |= (1 << 25))); /* 16 */
31843  goto l131288 ;
31844  }
31845 l131288 :
31846  ; /* 18 */
31847  ((int)(bitmapstruct.element8 |= (1 << 26))); /* 30 */
31848  commands_65zqendz ( 283 ) ; /* 30 */
31849  }
31850 /*!*************************************************************************************
31851  Function:
31852  bool GetDepthStatus(void)
31853  Summary:
31854  Function to enable/disable the FIRE Switch. SDS Warrior controls this setting.
31855  TRUE by default at power up.
31856  Remarks:
31857  Refer to the commands.h interface header for function usage details.
31858  */
31859 
31860 bool
31862  {
31863  int izzqqzz=((int)(bitmapstruct.element8 |= (1 << 27))); /* 37 */
31864  ((int)(bitmapstruct.element8 |= (1 << 28))); /* 30 */
31865  commands_65zqendz ( 285 ) ; /* 30 */
31866  return
31867  DepthStatus ;
31868  }
31869 /*!*************************************************************************************
31870  Function:
31871  bool Valid_Command( uchar8_t msg )
31872  Summary:
31873  Function receives a command for validation and returns a true if it is
31874  a valid command.
31875  Remarks:
31876  Refer to the commands.h interface header for function usage details.
31877  */
31878 
31879 bool
31881  uchar8_t msg )
31882  {
31883  int izzqqzz=((int)(bitmapstruct.element8 |= (1 << 29))); /* 37 */
31884  bool
31885  ans ; /* Returned value from check.*/
31886 
31887  const uchar8_t
31888  CommandBitMap [ 103 ] = { 0x30U , 0x31U , 0x32U , 0x33U , 0x34U , 0x35U , /* Valid commands.*/
31889  0x36U , 0x37U , 0x38U , 0x39U , 0x3AU , 0x3BU , 0x3CU , 0x3DU , 0x3EU , 0x3FU , 0x40U , 0x41U , 0x42U , 0x43U , 0x44U , 0x45U , 0x50U , 0x51U , 0x52U , 0x53U , 0x54U , 0x55U , 0x56U , 0x57U , 0x58U , 0x59U ,
31890  0x5AU , 0x5BU , 0x5CU , 0x5DU , 0x5EU , 0x5FU , 0x60U , 0x61U , 0x62U , 0x63U , 0x64U , 0x65U , 0x66U , 0x67U , 0x68U , 0x69U , 0x6AU , 0x6BU , 0x6CU , 0x6DU , 0x6FU , 0x70U , 0x80U , 0x81U , 0x82U , 0x83U ,
31891  0x84U , 0x85U , 0x86U , 0x87U , 0x88U , 0x89U , 0x8AU , 0x8BU , 0x8CU , 0x8DU , 0x8EU , 0x8FU , 0x90U , 0x91U , 0x92U , 0x93U , 0x94U , 0x95U , 0x96U , 0x97U , 0x98U , 0x99U , 0x9AU , 0x9BU , 0x9CU , 0x9DU ,
31892  0x9EU , 0x9FU , 0xA0U , 0xA1U , 0xA2U , 0xAU , 0xA4U , 0xA5U , 0xA6U , 0xA7U , 0xA8U , 0xA9U , 0xAAU , 0xABU , 0xACU , 0xADU , 0xAEU , 0xAFU , 0xB0U } ;
31893  ans = false ; /* Set response to false.*/
31894  if
31895  ( /* 50 */
31896  (
31897 
31898  ( /* 52 */
31899  (
31900  strchr (
31901  ( char * ) CommandBitMap , msg ) != NULL
31902  )
31903  ? (bitmapstruct.element8 |= (1 << 30 ), 1)
31904  : (bitmapstruct.element8 |= (1 << 31 ), 0) ) /* 54 */
31905  &&
31906  ( msg != 0U )
31907  ) /* Perform a compare to look for the command in the list.*/
31908  ) /* 1 */
31909  {
31910  ((int)(bitmapstruct.element9 |= (1 << 0))); /* 1 */
31911  {
31912  ans = true ; /* If we found a match, set to true.*/
31913  }
31914  ((int)(bitmapstruct.element9 |= (1 << 1))); /* 3 */
31915  }
31916  else /* Otherwise,*/
31917  {
31918  ((int)(bitmapstruct.element9 |= (1 << 2))); /* 2 */
31919  {
31920  ans = false ; /* set to false.*/
31921  }
31922  }
31923  ((int)(bitmapstruct.element9 |= (1 << 3))); /* 30 */
31924  commands_65zqendz ( 292 ) ; /* 30 */
31925  return
31926  ans ;
31927  }
31928 /***************************************************************************************
31929  End of File
31930  */
31931 #define qqqbranches 292
31932 #define QQQMAXMCDCSIZE 2
31933 /********************** LDRA_PORT INSTRUMENTATION **********************/
31934 
31935 /******************* END OF LDRA_PORT INSTRUMENTATION ******************/
31936 #define ldra_sscanf
31937  /* put in undefs to protect our parameter names from macros */
31938 #undef f
31939 #undef i
31940 #undef j
31941 #undef k
31942 #undef s
31943 #undef l
31944 #undef ii
31945 #undef some
31946 #undef none
31947 #undef from
31948 #undef a
31949 #undef b
31950 #undef iz
31951 #undef jz
31952 #undef qqnull_params
31953 #define qqnull_params void
31954  /* Conventional Instrumentation */
31955 #define qqzzidfield 1
31956  /* single file or fileid */
31957  /* these have an extra field for the fileid */
31958  static char qqqqone[] = "%6d\n"; /* single point */
31959  /* uncompressed data structures */
31960  /* uncompressed bitmap */
31961 #define QQQFIXEDSIZE
31962  static int qqqlast = 0;
31963  extern int qqupload_registered;
31964  extern int commands_65zqqzqz(qqnull_params);
31965  extern int commands_65zqqzqz1(qqnull_params);
31966  /* ----------------------------------------------------------------------* 200 *
31967  * Procedures
31968  * -----------------------------------------------------------------------------
31969  */
31970  /* ----------- zscanf ---------------------------------------------------* 201 *
31971  * Returns an integer extracted from a string
31972  * -----------------------------------------------------------------------------
31973  */
31974  static int commands_65zscanf(char * qqscan_str)
31975  {
31976  int qqvalue;
31977  int qqisign;
31978  char * qqcptr;
31979  qqvalue = 0;
31980  qqisign = 1;
31981  qqcptr = qqscan_str;
31982  /* Skip spaces */
31983  while (qqcptr[0] == ' ')
31984  {
31985  qqcptr++;
31986  }
31987  /* Check for a leading ---
31988  */
31989  if (qqcptr[0] == '-')
31990  {
31991  qqisign = -1;
31992  qqcptr++;
31993  }
31994  /* Extract digits */
31995  while ((qqcptr[0] >= '0') && (qqcptr[0] <= '9'))
31996  {
31997  qqvalue = 10 * qqvalue;
31998  qqvalue = qqvalue + (qqcptr[0] - '0');
31999  qqcptr++;
32000  }
32001  qqvalue = qqisign * qqvalue;
32002  return qqvalue;
32003  } /* end of zscanf */
32004  /* ----------------------------------------------------------------------* 210 *
32005  * C System utilities in use:
32006  * fprintf
32007  * fclose
32008  * sscanf
32009  * -----------------------------------------------------------------------------
32010  */
32011  /* ----------------------------------------------------------------------* 213 *
32012  * qqoutput* suite
32013  * Main output routines. These may require modification.
32014  * -----------------------------------------------------------------------------
32015  */
32016  /* ----------------------------------------------------------------------* 214 *
32017  * qqoutput
32018  * This is the principle output routine.
32019  * -----------------------------------------------------------------------------
32020  */
32021  static void qqoutput(FILEPOINT char * s,int i)
32022  /* f - file pointer, s - format string, i - integer for probe value */
32023  {
32024  /* printing to a file */
32025  /* fprintf exists, not threaded */
32026  /* fprintf exists, not threaded, ( SINGLEFILE or FILEID ) */
32027  ldra_sprintf2 (&ldra_buffer[0], s,i,zzfileid);
32028  ldra_port_write (&ldra_buffer[0]);
32029  } /* end of qqoutput */
32030  /* ----------------------------------------------------------------------* 215 *
32031  * qqoutput0
32032  * -----------------------------------------------------------------------------
32033  */
32034  static void qqoutput0(FILEPOINT char * s)
32035  {
32036  ldra_port_write(s);
32037  } /* end of qqoutput0 */
32038  /* ----------------------------------------------------------------------* 216 *
32039  * qqoutput2
32040  * -----------------------------------------------------------------------------
32041  */
32042  static void qqoutput2(FILEPOINT char * s,int i, int j)
32043  {
32044  ldra_sprintf2 (&ldra_buffer[0], s, i, j);
32045  ldra_port_write (&ldra_buffer[0]);
32046  } /* end of qqoutput2 */
32047  /* ----------------------------------------------------------------------* 217 *
32048  * qqoutput3
32049  * -----------------------------------------------------------------------------
32050  */
32051  static void qqoutput3(FILEPOINT char * s,int i,int j,int k)
32052  {
32053  ldra_sprintf3 (&ldra_buffer[0], s, i, j, k);
32054  ldra_port_write (&ldra_buffer[0]);
32055  } /* end of qqoutput3 */
32056  /* ----------------------------------------------------------------------* 218 *
32057  * qqoutput4
32058  * -----------------------------------------------------------------------------
32059  */
32060  static void qqoutput4(FILEPOINT char * s,int i,int j,int k,int l)
32061  {
32062  ldra_sprintf4 (&ldra_buffer[0], s, i, j, k, l);
32063  ldra_port_write (&ldra_buffer[0]);
32064  } /* end of qqoutput4 */
32065  /* ----------------------------------------------------------------------* 219 *
32066  * end of qqoutput* suite
32067  * -----------------------------------------------------------------------------
32068  */
32069  /* ----------------------------------------------------------------------* 222 *
32070  * qqqqinitialise
32071  * This procedure initialises the structures for
32072  * compressed execution histories.
32073  * -----------------------------------------------------------------------------
32074  */
32075  static void qqqqinitialise(int ii)
32076  {
32077  unsigned int i;
32078  /* First time through. */
32079  /* bitmap */
32080  /* bitmap separate */
32081  qqqlast = 1; /* stops qqfun() calling initialise again */
32082  /* bitmap */
32083  /* bitmap singlefile */
32084  /* struct singlefile notmainfl */
32085  } /* end of qqqqinitialise */
32086 /* ----------------------------------------------------------------------* 225 *
32087 * qqqbitmapreset
32088 * This procedure resets the structures for
32089 * compressed execution histories.
32090 * -----------------------------------------------------------------------------
32091 */
32092 static void qqqbitmapreset()
32093 {
32094 struct bitmapstruct_t localbitmap = {0};
32095 bitmapstruct = localbitmap;
32096 } /* end of qqqbitmapreset */
32097 #undef QQQTEMP1
32098 #define QQQTEMP1
32099  /* ----------- zqqzqz ---------------------------------------------------* 310 *
32100  * -----------------------------------------------------------------------------
32101  */
32102  /* ----------------------------------------------------------------------* 312 *
32103  * This routine opens the execution history file. It is instrumented at the
32104  * start of the main program if one exists in the file. In general this is
32105  * superceded by commands_65zqqzqz1 below.
32106  * -----------------------------------------------------------------------------
32107  */
32109  {
32110  if ( commands_65zzopen != 1 )
32111  {
32112 #undef QQQMUSTOPEN
32113  commands_65zzopen = 1;
32114  }
32115  return(1);
32116  } /* end of zqqzqz */
32117  /* ----------- zqqzqz1 --------------------------------------------------* 315 *
32118  * -----------------------------------------------------------------------------
32119  */
32120  /* ----------------------------------------------------------------------* 317 *
32121  * This routine also opens the execution history file. It is called
32122  * automatically if a probe fires and the execution history is not already
32123  * opened (commands_65zzopen = 0 ).
32124  * Because this always works ( it was intended for files with no main program
32125  * it is now the de facto common way to open the execution history.
32126  * -----------------------------------------------------------------------------
32127  */
32129  {
32130  if ( commands_65zzopen != 1 )
32131  {
32132  ldra_port_open(); /* 7 */
32133  qqqqinitialise(0);
32134  commands_65zzopen = 1;
32135  }
32136  return(1);
32137  } /* end of zqqzqz1 */
32138  /* ----------- zqendz ---------------------------------------------------* 330 *
32139  * This routine is called on exiting a routine in a
32140  * module. It closes the execution history.
32141  * -----------------------------------------------------------------------------
32142  */
32143 static int commands_65zqendz(int qqqi)
32144  {
32145  if (!qqqstructzzopen)
32146  {
32148  qqqstructzzopen = 1;
32149  }
32150  if ( commands_65zzopen != 1 )
32151  {
32152  commands_65zqqzqz1();
32153  }
32154  /* ----------------------------------------------------------------------* 331 *
32155  * this is the one which puts an integer into
32156  * the execution history file and returns unity.
32157  * The format of each field consists of six columns,
32158  * the number is right justified in this field.
32159  * -----------------------------------------------------------------------------
32160  */
32161  if ( commands_65zzopen )
32162  {
32163  /* uncompressed */
32164  /* uncompressed unbuffered */
32165  /* uncompressed unbuffered bitmap */
32166  if ( qqqi > 0 )
32167  {
32168  }
32169  else
32170  {
32171  }
32172  }
32173  qqqlast = 0;
32174  return(1);
32175  } /* end of zqendz */
32176  /* ----------------------------------------------------------------------* 335 *
32177  * Output structure - qqbmsoutput
32178  * -----------------------------------------------------------------------------
32179  */
32180  static void qqbmsoutput(FILEPOINT char * s, unsigned int i)
32181  {
32182  static int branches_printed = 0;
32183  int b, last = 0;
32184  for(b=0;b<qqqqbmselwidth/8;b++)
32185  {
32186  ldra_sprintf1 (&ldra_buffer[0], s, (i >> last) & ~(~0 << 8));
32187  ldra_port_write (&ldra_buffer[0]);
32188  ldra_sprintf1 (&ldra_buffer[0], "%8d\n", zzfileid );
32189  ldra_port_write (&ldra_buffer[0]);
32190  last += 8;
32191  branches_printed += 8;
32192  if (branches_printed >= qqqbranches)
32193  {
32194  /* do not print any more, can be left over when using more than 8 bits to store bitmap */
32195  break;
32196  }
32197  }
32198  }
32199  /* ----------------------------------------------------------------------* 336 *
32200  * qqqupload
32201  * This routine loops through the stored bitmap and
32202  * outputs it. It then uploads the stored mcdc.
32203  * -----------------------------------------------------------------------------
32204  */
32205  static void qqqupload(qqnull_params)
32206  {
32207  int i;
32208  /* uncompressed bitmap (!singlefile or mainfl) separate */
32209  {
32210  commands_65zqqzqz1();
32211 #define ELEMENT(N) qqbmsoutput("%8d", bitmapstruct.element##N);
32212 #define LASTELEMENT
32213 #include "commands_65zbelem.def"
32214 #undef LASTELEMENT
32215 #undef ELEMENT
32216  }
32217  /* bitmap separate */
32218  qqqlast = 1; /* stops qqfun() calling initialise again */
32219  } /* end of qqqupload */
32220  /* ----------- zqzqzq ---------------------------------------------------* 342 *
32221  * -----------------------------------------------------------------------------
32222  */
32223  /* ----------------------------------------------------------------------* 344 *
32224  * This routine should be called before the program
32225  * terminates. It closes the execution history
32226  * -----------------------------------------------------------------------------
32227  */
32228  static int commands_65zqzqzq(int qqqi)
32229  {
32230  if ( commands_65zzopen != 1 )
32231  {
32232  commands_65zqqzqz1();
32233  }
32234  /* not compressed */
32235  /* do nothing for bitmap*/
32236  /* upload the history */
32237  /* bitmap */
32238  /* uncompressed bitmap */
32239  commands_65zqendz(qqqi);
32240  /* qqqupload closes the execution history file */
32241  return(1);
32242  } /* end of zqzqzq */
32243  /* the following routines should be left alone */
32244 /* END OF TESTBED INSTRUMENTATION */
32245 
uint32_t DRV_TMR1_PeriodValueGet(void)
void DRV_ADC1_Open(void)
DRV_IO_INTENT
uint16_t PLIB_DMA_ChannelXPeripheralAddressGet(DMA_MODULE_ID index, DMA_CHANNEL channel)
S3_COMMAND
Definition: inszt_app.c:27690
bool PLIB_SPI_ExistsOutputDataPhase(SPI_MODULE_ID index)
void PLIB_USART_BaudSetAndEnable(USART_MODULE_ID index, uint32_t systemClock, uint32_t baud)
APP_DATA APP
Definition: app.c:73
bool PLIB_USART_ExistsTransmitterBreak(USART_MODULE_ID index)
bool PLIB_PORTS_ExistsLatchRead(PORTS_MODULE_ID index)
void SYS_DMA_ChannelTransferEventHandlerSet(SYS_DMA_CHANNEL_HANDLE handle, const SYS_DMA_CHANNEL_TRANSFER_EVENT_HANDLER eventHandler, const uintptr_t contextHandle)
void DRV_ADC0_Close(void)
bool PLIB_PORTS_PinGetLatched(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
void PLIB_PORTS_ChannelChangeNoticeDisable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_MASK mask)
void PLIB_DMA_CRCWriteByteOrderMaintain(DMA_MODULE_ID index)
#define DRV_IC_Close(handle)
SPI_BAUD_RATE_CLOCK baudClockSource
Definition: inszt_adc.c:26566
static void DRV_TMR1_DeInitialize(void)
void Calc_CRC(uint16_t nbits, uint8_t thebits)
Definition: crc.c:55
uint16_t max_current
Definition: inszt_app.c:28642
void PLIB_SPI_ReceiverOverflowClear(SPI_MODULE_ID index)
void SYS_DMA_ChannelRelease(SYS_DMA_CHANNEL_HANDLE handle)
bool PLIB_DMA_ChannelXNullWriteModeIsEnabled(DMA_MODULE_ID index, DMA_CHANNEL channel)
void * PLIB_SPI_BufferAddressGet(SPI_MODULE_ID index)
void SYS_PORTS_PinModeSelect(PORTS_MODULE_ID index, PORTS_ANALOG_PIN pin, PORTS_PIN_MODE mode)
void PLIB_USART_Enable(USART_MODULE_ID index)
SYS_DMA_CHANNEL_HANDLE SYS_DMA_ChannelAllocate(DMA_CHANNEL channel)
DRV_USART_BUFFER_RESULT
uint32_t PLIB_DMA_CRCXOREnableGet(DMA_MODULE_ID index)
uint16_t PLIB_DMA_ChannelXSourcePointerGet(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel)
bool Valid_Command(uchar8_t msg)
DRV_USART_LINE_CONTROL_SET_RESULT DRV_USART_LineControlSet(const DRV_HANDLE client, const DRV_USART_LINE_CONTROL lineControl)
bool PLIB_DMA_ExistsChannelXAuto(DMA_MODULE_ID index)
uint32_t DRV_TMR0_CounterFrequencyGet(void)
void PLIB_USART_IrDADisable(USART_MODULE_ID index)
uint32_t DRV_TMR1_CounterFrequencyGet(void)
void PLIB_DMA_ChannelXChainToLower(DMA_MODULE_ID index, DMA_CHANNEL channel)
void PLIB_SPI_CommunicationWidthSelect(SPI_MODULE_ID index, SPI_COMMUNICATION_WIDTH width)
bool PLIB_SPI_FIFOShiftRegisterIsEmpty(SPI_MODULE_ID index)
uint8_t DRV_USART_ReadByte(const DRV_HANDLE handle)
void PLIB_USART_RunInOverflowDisable(USART_MODULE_ID index)
SWITCH_COMMAND SW_COM
Definition: switches.c:61
COMMAND_STATES
Definition: commands.h:62
uint32_t PLIB_SPI_BufferRead32bit(SPI_MODULE_ID index)
TMR_PRESCALE DRV_TMR3_PrescalerGet(void)
void DRV_USART_BufferEventHandlerSet(const DRV_HANDLE handle, const DRV_USART_BUFFER_EVENT_HANDLER eventHandler, const uintptr_t context)
uint8_t cmd_size
Definition: commands.h:76
void SYS_PORTS_Toggle(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_MASK toggleMask)
static int commands_65zscanf(char *qqscan_str)
static int tbrun_mode
void DRV_TMR_AlarmPeriodSet(DRV_HANDLE handle, uint32_t value)
void PLIB_DMA_CRCAppendModeEnable(DMA_MODULE_ID index)
DRV_USART_LINE_CONTROL_SET_RESULT
PORTS_PIN_SLEW_RATE PLIB_PORTS_PinSlewRateGet(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
void PLIB_PORTS_RemapOutput(PORTS_MODULE_ID index, PORTS_REMAP_OUTPUT_FUNCTION outputFunction, PORTS_REMAP_OUTPUT_PIN remapOutputPin)
void SYS_PORTS_PinPullUpDisable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
void Set_Status(uint8_t bitposn)
uint16_t PORTS_DATA_MASK
Definition: inszt_adc.c:18519
void DRV_PMP0_Write(uint8_t data)
bool DepthStatus
bool PLIB_DMA_ExistsStartTransfer(DMA_MODULE_ID index)
void DRV_TMR0_CounterClear(void)
SPI_FRAME_PULSE_POLARITY framePulsePolarity
Definition: inszt_adc.c:26551
bool PLIB_PORTS_ExistsSlewRateControl(PORTS_MODULE_ID index)
bool DRV_TMR_GateModeSet(DRV_HANDLE handle)
void PLIB_USART_OperationModeSelect(USART_MODULE_ID index, USART_OPERATION_MODE operationmode)
void DRV_ADC1_Close(void)
void WL_SPS_Tasks(void)
bool PLIB_PORTS_ExistsAnPinsMode(PORTS_MODULE_ID index)
bool PLIB_DMA_ExistsRecentAddress(DMA_MODULE_ID index)
void PLIB_PORTS_DirectionOutputSet(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_MASK mask)
static void Init_WL_CPS(void)
bool PLIB_DMA_ChannelXChainIsEnabled(DMA_MODULE_ID index, DMA_CHANNEL channel)
void DRV_USART_AddressedBufferAddWrite(const DRV_HANDLE hClient, DRV_USART_BUFFER_HANDLE *bufferHandle, uint8_t address, void *source, size_t nWords)
static void Execute_Protocol_B(void)
float float32_t
Definition: cf.h:50
void SYS_PORTS_PinClear(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
void PLIB_PORTS_ChangeNoticeEnable(PORTS_MODULE_ID index)
void DRV_TMR4_PeriodValueSet(uint32_t value)
static void DRV_TMR2_Close(void)
bool PLIB_USART_RunInOverflowIsEnabled(USART_MODULE_ID index)
DMA_PING_PONG_MODE PLIB_DMA_ChannelXPingPongModeGet(DMA_MODULE_ID index, DMA_CHANNEL channel)
DRV_CLIENT_STATUS
bool SYS_PORTS_PinLatchedGet(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
SYS_DMA_DATA_WIDTH
bool PLIB_USART_ExistsReceiverFramingErrorStatus(USART_MODULE_ID index)
static void Execute_Protocol_A(void)
uint32_t DRV_TMR0_CounterValueGet(void)
bool PLIB_USART_ExistsTransmitterInterruptMode(USART_MODULE_ID index)
void PLIB_USART_InitializeModeGeneral(USART_MODULE_ID index, bool autobaud, bool loopBackMode, bool wakeFromSleep, bool irdaMode, bool stopInIdle)
void DRV_TMR3_Initialize(void)
S3_COMMAND
PORTS_PIN_INTERRUPT_TYPE
DRV_SPI_PROTOCOL_TYPE
Definition: inszt_adc.c:26367
void PLIB_SPI_FrameErrorStatusClear(SPI_MODULE_ID index)
static DRV_TMR_OPERATION_MODE DRV_TMR3_OperationModeGet(void)
void PLIB_DMA_ChannelXStartAddressOffsetSet(DMA_MODULE_ID index, DMA_CHANNEL channel, uint16_t address, DMA_ADDRESS_OFFSET_TYPE offset)
bool PLIB_DMA_ChannelXEventIsDetected(DMA_MODULE_ID index, DMA_CHANNEL channel)
void SYS_DMA_ChannelTransferSet(SYS_DMA_CHANNEL_HANDLE handle, const void *srcAddr, size_t srcSize, const void *destAddr, size_t destSize, size_t cellSize)
void SYS_PORTS_ChangeNotificationPullUpDisable(PORTS_MODULE_ID index, PORTS_CHANGE_NOTICE_PIN pinNum)
DRV_USART_LINE_CONTROL_SET_RESULT
Definition: inszt_adc.c:15287
void Prepare_Return_B(uint8_t byt [])
DMA_CHANNEL_INT_SOURCE PLIB_DMA_ChannelXTriggerSourceNumberGet(DMA_MODULE_ID index, DMA_CHANNEL channel)
Definition: hvps.h:84
void PLIB_USART_TransmitterIdleIsLowEnable(USART_MODULE_ID index)
void PLIB_SPI_AudioCommunicationWidthSelect(SPI_MODULE_ID index, SPI_AUDIO_COMMUNICATION_WIDTH mode)
void PLIB_DMA_ChannelXReloadEnable(DMA_MODULE_ID index, DMA_CHANNEL channel)
void PLIB_PORTS_ChannelChangeNoticeEnable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_MASK mask)
void PLIB_DMA_ChannelXDestinationAddressModeSelect(DMA_MODULE_ID index, DMA_CHANNEL channel, DMA_DESTINATION_ADDRESSING_MODE destinationAddressMode)
void PLIB_USART_TransmitterBreakSend(USART_MODULE_ID index)
void SYS_PORTS_OpenDrainEnable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_MASK mask)
static void DRV_TMR2_Tasks(void)
void DRV_TMR_Stop(DRV_HANDLE handle)
bool PLIB_DMA_ExistsChannelXAbortIRQ(DMA_MODULE_ID index)
DRV_USART_TRANSFER_STATUS DRV_USART0_TransferStatus(void)
WL_SPS_STATES
Definition: inszt_app.c:28425
DRV_SPI_BUFFER_EVENT
static void Init_Manchester(void)
bool PLIB_DMA_IsEnabled(DMA_MODULE_ID index)
DRV_USART_LINE_CONTROL
void DRV_TMR3_Stop(void)
#define commands_65zqqzqz1
void PLIB_DMA_ChannelXINTSourceFlagClear(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel, DMA_INT_TYPE dmaINTSource)
bool PLIB_SPI_ExistsFrameSyncPulseWidth(SPI_MODULE_ID index)
bool PLIB_USART_ExistsBRGClockSourceSelect(USART_MODULE_ID index)
bool PLIB_DMA_ExistsCRC(DMA_MODULE_ID index)
void DRV_USART_BufferAddRead(const DRV_HANDLE handle, DRV_USART_BUFFER_HANDLE *const bufferHandle, void *buffer, const size_t size)
void SET_WL_SPS_IOffset(uint8_t mode)
bool PLIB_SPI_ExistsFIFOCount(SPI_MODULE_ID index)
bool PLIB_DMA_ExistsChannelXCellProgressPointer(DMA_MODULE_ID index)
void PLIB_DMA_ChannelXPatternDataSet(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel, uint16_t patternData)
bool PLIB_USART_ExistsReceiverEnable(USART_MODULE_ID index)
DRV_USART_LINE_CONTROL
Definition: inszt_adc.c:15315
SYS_MODULE_OBJ DRV_USART_Initialize(const SYS_MODULE_INDEX index, const SYS_MODULE_INIT *const init)
SYS_STATUS DRV_SPI_Status(SYS_MODULE_OBJ object)
bool PLIB_PORTS_ExistsPinChangeNoticePerPort(PORTS_MODULE_ID index)
DRV_TMR_OPERATION_MODE DRV_TMR1_DividerRangeGet(DRV_TMR_DIVIDER_RANGE *pDivRange)
bool DRV_USART0_ReceiverBufferIsEmpty(void)
void PLIB_DMA_ChannelXPatternIgnoreByteDisable(DMA_MODULE_ID index, DMA_CHANNEL channel)
void PLIB_USART_WakeOnStartEnable(USART_MODULE_ID index)
void PLIB_DMA_CRCByteOrderSelect(DMA_MODULE_ID index, DMA_CRC_BYTE_ORDER byteOrder)
DRV_USART_BAUD_SET_RESULT
Definition: inszt_adc.c:15266
bool PLIB_DMA_ChannelXINTSourceIsEnabled(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel, DMA_INT_TYPE dmaINTSource)
bool PLIB_PORTS_PinGet(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
SYS_STATUS DRV_TMR_Status(SYS_MODULE_OBJ object)
DMA_CHANNEL_PRIORITY PLIB_DMA_ChannelPriorityGet(DMA_MODULE_ID index)
SYS_MODULE_OBJ DRV_IC_Initialize(const SYS_MODULE_INDEX index, const SYS_MODULE_INIT *const init)
#define DRV_IC_Open(drvIndex, intent)
void PLIB_PORTS_ChannelChangeNoticePullUpDisable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_MASK mask)
void SWITCH_Tasks(void)
bool PLIB_DMA_ExistsChannelXDestinationSize(DMA_MODULE_ID index)
void PLIB_DMA_ChannelXSourceStartAddressSet(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel, uint32_t sourceStartAddress)
uint32_t PLIB_DMA_ChannelXSourceStartAddressGet(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel)
bool PLIB_USART_ExistsHandshakeMode(USART_MODULE_ID index)
bool PLIB_USART_ExistsStopInIdle(USART_MODULE_ID index)
void DRV_TMR1_CounterValueSet(uint32_t value)
COMM_STATES
Definition: commmodule.h:55
static int qqqlast
void qqpopulate_array_fcn_ptrQQ(int x, ldra_void_function y, ldra_void_function z)
Definition: inszt_main.c:157
S7_COMMAND
Definition: inszt_app.c:27723
bool PLIB_DMA_ExistsChannelXINTSource(DMA_MODULE_ID index)
USART_ERROR PLIB_USART_ErrorsGet(USART_MODULE_ID index)
FSK_STATES
static void Init_FSK(void)
bool PLIB_SPI_ExistsPinControl(SPI_MODULE_ID index)
uint32_t DRV_TMR3_CounterValueGet(void)
uint8_t jobQueueReserveSize
Definition: inszt_adc.c:26596
void PLIB_USART_RunInOverflowEnable(USART_MODULE_ID index)
bool PLIB_PORTS_ExistsRemapOutput(PORTS_MODULE_ID index)
bool PLIB_USART_ExistsReceiverParityErrorStatus(USART_MODULE_ID index)
void PLIB_SPI_BaudRateClockSelect(SPI_MODULE_ID index, SPI_BAUD_RATE_CLOCK type)
DRV_TMR_CLIENT_STATUS
Definition: inszt_adc.c:1801
uint32_t DRV_TMR4_PeriodValueGet(void)
void SYS_DEBUG_Reinitialize(SYS_MODULE_OBJ object, const SYS_MODULE_INIT *const init)
SYS_MODULE_INIT moduleInit
Definition: inszt_adc.c:26535
void DRV_TMR2_StopInIdleDisable(void)
void DRV_TMR1_Stop(void)
void PLIB_PORTS_ChangeNoticePullDownPerPortEnable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
void PLIB_DMA_ChannelXTransferDirectionSelect(DMA_MODULE_ID index, DMA_CHANNEL channel, DMA_CHANNEL_TRANSFER_DIRECTION chTransferDirection)
SYS_ERROR_LEVEL
static DRV_TMR_OPERATION_MODE DRV_TMR0_OperationModeGet(void)
void SYS_PORTS_PinPullUpEnable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
ldra_void_function qqqaccumupload[QQQnumfil]
Definition: inszt_main.c:153
DRV_TMR_OPERATION_MODE DRV_TMR0_DividerRangeGet(DRV_TMR_DIVIDER_RANGE *pDivRange)
void PLIB_PORTS_ChangeNoticePerPortTurnOn(PORTS_MODULE_ID index, PORTS_CHANNEL channel)
bool PLIB_DMA_ExistsChannelXPatternData(DMA_MODULE_ID index)
void DRV_USART_ByteTransmitCallbackSet(const SYS_MODULE_INDEX index, const DRV_USART_BYTE_EVENT_HANDLER eventHandler)
void PLIB_DMA_ChannelXINTSourceDisable(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel, DMA_INT_TYPE dmaINTSource)
bool PLIB_PORTS_ExistsChangeNoticePerPortStatus(PORTS_MODULE_ID index)
int8_t PLIB_USART_ReceiverByteReceive(USART_MODULE_ID index)
static void qqoutput0(FILEPOINT char *s)
MAN_PROCESS_STATES
Definition: inszt_app.c:29386
bool PLIB_DMA_ExistsCRCPolynomialLength(DMA_MODULE_ID index)
void Calc_Auto_Bias(void)
Definition: inszt_man.c:30558
uint8_t PLIB_DMA_ChannelXPatternIgnoreGet(DMA_MODULE_ID index, DMA_CHANNEL channel)
uintptr_t DRV_SPI_BUFFER_HANDLE
void PLIB_SPI_ErrorInterruptDisable(SPI_MODULE_ID index, SPI_ERROR_INTERRUPT error)
COMM_STATES
static int qqqisinitialised
Definition: inszt_main.c:152
void DRV_USART0_Deinitialize(void)
bool send_message_complete_flag
Definition: fsk.h:84
void DRV_USART_Close(const DRV_HANDLE handle)
static void DRV_TMR2_Open(void)
DRV_SPI_TASK_MODE
Definition: inszt_adc.c:26444
SYS_PORTS_PULLUP_PULLDOWN_STATUS
uint16_t store_buffer[2]
Definition: inszt_app.c:27671
void PLIB_DMA_CRCEnable(DMA_MODULE_ID index)
bool DRV_IC0_BufferIsEmpty(void)
void PLIB_USART_LineControlModeSelect(USART_MODULE_ID index, USART_LINECONTROL_MODE dataFlowConfig)
static void DRV_TMR1_Open(void)
bool spi_write_complete_flag
Definition: inszt_app.c:28650
void COMM_Tasks(void)
Definition: commmodule.c:88
bool PLIB_PORTS_ExistsPinMode(PORTS_MODULE_ID index)
DRV_USART_BUFFER_EVENT
static void Send_Mark(void)
void PLIB_SPI_FramedCommunicationDisable(SPI_MODULE_ID index)
void PLIB_DMA_ChannelXAbortIRQSet(DMA_MODULE_ID index, DMA_CHANNEL channel, DMA_TRIGGER_SOURCE IRQ)
void PLIB_SPI_FrameSyncPulseDirectionSelect(SPI_MODULE_ID index, SPI_FRAME_PULSE_DIRECTION direction)
bool DRV_TMR1_Start(void)
void PLIB_USART_LoopbackDisable(USART_MODULE_ID index)
void SYS_DMA_ChannelSetupMatchAbortMode(SYS_DMA_CHANNEL_HANDLE handle, uint16_t pattern, DMA_PATTERN_LENGTH length, SYS_DMA_CHANNEL_IGNORE_MATCH ignore, uint8_t ignorePattern)
void PLIB_DMA_CRCChannelSelect(DMA_MODULE_ID index, DMA_CHANNEL channel)
void PLIB_PORTS_PinChangeNoticeEnable(PORTS_MODULE_ID index, PORTS_CHANGE_NOTICE_PIN pinNum)
static void execute_switches(void)
void PLIB_USART_WakeOnStartDisable(USART_MODULE_ID index)
void SYS_PORTS_ChangeNotificationInIdleModeEnable(PORTS_MODULE_ID index)
void PLIB_USART_ReceiverAddressAutoDetectEnable(USART_MODULE_ID index, int8_t Mask)
void PLIB_PORTS_OpenDrainDisable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_MASK mask)
void PLIB_DMA_Enable(DMA_MODULE_ID index)
void DRV_TMR1_CounterClear(void)
bool PLIB_USART_ModuleIsBusy(USART_MODULE_ID index)
void PLIB_DMA_CRCTypeSet(DMA_MODULE_ID index, DMA_CRC_TYPE CRCType)
INT_SOURCE txInterruptSource
Definition: inszt_adc.c:26580
bool PLIB_USART_TransmitterBufferIsFull(USART_MODULE_ID index)
void PLIB_DMA_BusyActiveSet(DMA_MODULE_ID index)
DMA_SOURCE_ADDRESSING_MODE PLIB_DMA_ChannelXSourceAddressModeGet(DMA_MODULE_ID index, DMA_CHANNEL channel)
void DRV_TMR0_Stop(void)
DRV_SPI_BUFFER_TYPE
Definition: inszt_adc.c:26344
MAN_DATA MAN
Definition: man.c:67
uint32_t DRV_TMR1_CounterValueGet(void)
void(* DRV_USART_BYTE_EVENT_HANDLER)(const SYS_MODULE_INDEX index)
void APP_Tasks(void)
Definition: app.c:130
uintptr_t DRV_HANDLE
DMA_CHANNEL_DATA_SIZE PLIB_DMA_ChannelXDataSizeGet(DMA_MODULE_ID index, DMA_CHANNEL channel)
DRV_HANDLE DRV_IC_Start(const SYS_MODULE_INDEX drvIndex, const DRV_IO_INTENT intent)
void SYS_DEBUG_Message(const char *message)
void PLIB_DMA_ChannelXNullWriteModeEnable(DMA_MODULE_ID index, DMA_CHANNEL channel)
static unsigned char qqqzzglobflag
bool PLIB_USART_RunInSleepModeIsEnabled(USART_MODULE_ID index)
MAN_RX_STATES
bool PLIB_SPI_ReceiverHasOverflowed(SPI_MODULE_ID index)
bool PLIB_PORTS_ExistsRemapInput(PORTS_MODULE_ID index)
void DRV_TMR1_StopInIdleEnable(void)
static void DRV_TMR0_Open(void)
Definition: fsk.h:123
void SYS_DMA_ChannelDisable(SYS_DMA_CHANNEL_HANDLE handle)
MAN_BIAS_DATA MAN_BIAS
Definition: man.c:65
bool DRV_SPIn_ReceiverBufferIsFull(void)
void DRV_TMR3_CounterClear(void)
DRV_SPI_BUFFER_EVENT
Definition: inszt_adc.c:26399
USART_BRG_CLOCK_SOURCE PLIB_USART_BRGClockSourceGet(USART_MODULE_ID index)
void SYS_PORTS_Initialize()
void DRV_USART0_WriteByte(const uint8_t byte)
void PLIB_SPI_AudioProtocolEnable(SPI_MODULE_ID index)
bool PLIB_USART_TransmitterBreakSendIsComplete(USART_MODULE_ID index)
DRV_USART_TRANSFER_STATUS
Definition: inszt_adc.c:15489
DRV_TMR_OPERATION_MODE
Definition: inszt_adc.c:1848
static bool Check_Manchester(void)
void DRV_PMP0_TimingSet(PMP_DATA_WAIT_STATES dataWait, PMP_STROBE_WAIT_STATES strobeWait, PMP_DATA_HOLD_STATES dataHold)
void DRV_SPI_Close(DRV_HANDLE handle)
void DRV_TMR1_StopInIdleDisable(void)
SYS_DMA_CHANNEL_IGNORE_MATCH
Definition: inszt_adc.c:13316
static void DRV_TMR4_Open(void)
void PLIB_SPI_AudioProtocolModeSelect(SPI_MODULE_ID index, SPI_AUDIO_PROTOCOL mode)
SPI_FRAME_PULSE_DIRECTION framePulseDirection
Definition: inszt_adc.c:26553
void SYS_DMA_ChannelCRCSet(SYS_DMA_CHANNEL_HANDLE handle, SYS_DMA_CHANNEL_OPERATION_MODE_CRC crc)
uint16_t PLIB_DMA_ChannelXTransferCountGet(DMA_MODULE_ID index, DMA_CHANNEL channel)
static void DRV_TMR4_Tasks(void)
bool PLIB_USART_ExistsIrDA(USART_MODULE_ID index)
bool PLIB_SPI_ExistsAudioTransmitMode(SPI_MODULE_ID index)
size_t SYS_DMA_ChannelDestinationTransferredSizeGet(SYS_DMA_CHANNEL_HANDLE handle)
DRV_SPI_CLOCK_MODE
void PLIB_USART_ReceiverAddressDetectDisable(USART_MODULE_ID index)
bool PLIB_PORTS_ChangeNoticePerPortHasOccurred(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
void SYS_DMA_Suspend(void)
SYS_DMA_ERROR
Definition: inszt_adc.c:13491
WL_SPS_DATA WL_SPS
Definition: wl_sps.c:59
bool PLIB_USART_BaudRateAutoDetectIsComplete(USART_MODULE_ID index)
void SYS_DEBUG_Print(const char *format,...)
uint32_t PLIB_USART_BaudRateGet(USART_MODULE_ID index, int32_t clockFrequency)
uint32_t dummyByteValue
Definition: inszt_adc.c:26589
bool DRV_TMR4_Start(void)
SYS_DMA_SIDL
Definition: inszt_adc.c:13275
uint8_t current_limit
Definition: inszt_app.c:28643
S7_COMMAND
WL_CPS_STATES
Definition: inszt_app.c:28620
void PLIB_PORTS_ChangeNoticePullUpEnable(PORTS_MODULE_ID index, PORTS_CHANGE_NOTICE_PIN pinNum)
void PLIB_PORTS_CnPinsPullUpDisable(PORTS_MODULE_ID index, PORTS_CN_PIN cnPins)
void SYS_DMA_ChannelAbortEventSet(SYS_DMA_CHANNEL_HANDLE handle, DMA_TRIGGER_SOURCE eventSrc)
SYS_DMA_CHANNEL_CRC_MODE
Definition: inszt_adc.c:13335
void SYS_PORTS_ChangeNotificationInIdleModeDisable(PORTS_MODULE_ID index)
bool DRV_SPIn_TransmitterBufferIsFull(void)
void PLIB_PORTS_ChangeNoticePullUpPerPortEnable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
void DRV_TMR0_CounterValueSet(uint32_t value)
bool PLIB_DMA_ExistsChannelXSourceSize(DMA_MODULE_ID index)
uintptr_t DRV_HANDLE
Definition: inszt_adc.c:1108
uint16_t PLIB_SPI_BufferRead16bit(SPI_MODULE_ID index)
DRV_SPI_PROTOCOL_TYPE spiProtocolType
Definition: inszt_adc.c:26545
bool PLIB_SPI_ExistsFIFOControl(SPI_MODULE_ID index)
void DRV_TMR4_Initialize(void)
void PLIB_DMA_ChannelPrioritySelect(DMA_MODULE_ID index, DMA_CHANNEL_PRIORITY channelPriority)
bool PLIB_DMA_ExistsCRCChannel(DMA_MODULE_ID index)
#define qqnull_params
void Set_WL_CPS_CurrentLimit(uint8_t value)
static SYS_STATUS DRV_TMR3_Status(void)
SPI_FRAME_PULSE_WIDTH framePulseWidth
Definition: inszt_adc.c:26557
void PLIB_PORTS_DirectionInputSet(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_MASK mask)
void PLIB_PORTS_ChangeNoticePerPortTurnOff(PORTS_MODULE_ID index, PORTS_CHANNEL channel)
static int zzfileid
void DRV_USART0_TasksTransmit(void)
uint32_t DRV_ADC_SamplesRead(uint8_t bufIndex)
bool PLIB_USART_ExistsRunInSleepMode(USART_MODULE_ID index)
bool PLIB_SPI_IsBusy(SPI_MODULE_ID index)
bool spi_write_complete_flag
Definition: inszt_app.c:29418
static void process_switches(void)
struct _DRV_SPI_INIT DRV_SPI_INIT
void PLIB_DMA_ChannelXSourceAddressModeSelect(DMA_MODULE_ID index, DMA_CHANNEL channel, DMA_SOURCE_ADDRESSING_MODE sourceAddressMode)
void PLIB_DMA_ChannelXDisabledEnablesEvents(DMA_MODULE_ID index, DMA_CHANNEL channel)
static void qqqqinitialise(int ii)
uint32_t baudRate
Definition: inszt_adc.c:26572
bool SYS_PORTS_PinRead(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
DRV_HANDLE DRV_USART0_Open(const SYS_MODULE_INDEX index, const DRV_IO_INTENT ioIntent)
bool PLIB_DMA_ExistsChannelXChainEnbl(DMA_MODULE_ID index)
SYS_DMA_CHANNEL_IGNORE_MATCH
DRV_SPI_BUFFER_HANDLE DRV_SPI_BufferAddRead(DRV_HANDLE handle, void *rxBuffer, size_t size, DRV_SPI_BUFFER_EVENT_HANDLER completeCB, void *context)
#define QQQnumfil
uint8_t DRV_USART0_ReadByte(void)
static struct bitmapstruct_t bitmapstruct
SYS_MODULE_OBJ DRV_SPI_Initialize(const SYS_MODULE_INDEX index, const SYS_MODULE_INIT *const init)
DRV_USART_INIT_FLAGS
PORTS_DATA_TYPE SYS_PORTS_LatchedGet(PORTS_MODULE_ID index, PORTS_CHANNEL channel)
void PLIB_SPI_BufferWrite32bit(SPI_MODULE_ID index, uint32_t data)
void SYS_PORTS_InterruptEnable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos, PORTS_PIN_INTERRUPT_TYPE pinInterruptType)
void PLIB_DMA_ChannelXDestinationStartAddressSet(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel, uint32_t destinationStartAddress)
bool PLIB_USART_ExistsBaudRate(USART_MODULE_ID index)
bool PLIB_PORTS_ExistsPortsRead(PORTS_MODULE_ID index)
bool PLIB_DMA_LastBusAccessIsWrite(DMA_MODULE_ID index)
DRV_SPI_BUFFER_HANDLE DRV_SPI_BufferAddWrite(DRV_HANDLE handle, void *txBuffer, size_t size, DRV_SPI_BUFFER_EVENT_HANDLER completeCB, void *context)
void PLIB_DMA_ChannelXTriggerEnable(DMA_MODULE_ID index, DMA_CHANNEL channel, DMA_CHANNEL_TRIGGER_TYPE trigger)
#define qqqbranches
void DRV_TMR_Deinitialize(SYS_MODULE_OBJ object)
HVPS_STATES
bool PLIB_SPI_ExistsTransmitBufferEmptyStatus(SPI_MODULE_ID index)
bool PLIB_USART_ReceiverDataIsAvailable(USART_MODULE_ID index)
unsigned char uchar8_t
Definition: commands.h:52
uint16_t current_limit
Definition: inszt_app.c:28458
bool PLIB_USART_WakeOnStartIsEnabled(USART_MODULE_ID index)
bool PLIB_SPI_ReceiverFIFOIsEmpty(SPI_MODULE_ID index)
uint32_t PLIB_DMA_CRCDataRead(DMA_MODULE_ID index)
SYS_PORTS_PIN_DIRECTION
Definition: inszt_adc.c:21888
void PLIB_USART_BaudRateAutoDetectEnable(USART_MODULE_ID index)
DRV_SPI_BUFFER_HANDLE DRV_SPI_BufferAddWrite2(DRV_HANDLE handle, void *txBuffer, size_t size, DRV_SPI_BUFFER_EVENT_HANDLER completeCB, void *context, DRV_SPI_BUFFER_HANDLE *jobHandle)
unsigned int DRV_USART_ReceiverBufferSizeGet(const DRV_HANDLE handle)
DRV_SPI_BUFFER_EVENT DRV_SPI_BufferStatus(DRV_SPI_BUFFER_HANDLE bufferHandle)
DMA_PATTERN_LENGTH PLIB_DMA_ChannelXPatternLengthGet(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel)
void SYS_DMA_ChannelForceAbort(SYS_DMA_CHANNEL_HANDLE handle)
bool PLIB_SPI_FrameErrorStatusGet(SPI_MODULE_ID index)
void FSK_Tasks(void)
Definition: fsk.c:104
void PLIB_SPI_FIFOInterruptModeSelect(SPI_MODULE_ID index, SPI_FIFO_INTERRUPT mode)
bool PLIB_USART_ExistsReceiverAddress(USART_MODULE_ID index)
void SYS_PORTS_ChangeNotificationEnable(PORTS_MODULE_ID index, PORTS_CHANGE_NOTICE_PIN pinNum, SYS_PORTS_PULLUP_PULLDOWN_STATUS value)
static SYS_STATUS DRV_TMR2_Status(void)
void PLIB_PORTS_PinModeSelect(PORTS_MODULE_ID index, PORTS_ANALOG_PIN pin, PORTS_PIN_MODE mode)
uint32_t DRV_TMR0_PeriodValueGet(void)
void SYS_PORTS_RemapInput(PORTS_MODULE_ID index, PORTS_REMAP_INPUT_FUNCTION function, PORTS_REMAP_INPUT_PIN remapPin)
bool PLIB_USART_ExistsReceiverAddressDetect(USART_MODULE_ID index)
void PLIB_PORTS_CnPinsEnable(PORTS_MODULE_ID index, PORTS_CN_PIN cnPins)
void PLIB_DMA_ChannelXEnable(DMA_MODULE_ID index, DMA_CHANNEL channel)
PORTS_CHANGE_NOTICE_METHOD PLIB_PORTS_ChannelChangeNoticeMethodGet(PORTS_MODULE_ID index, PORTS_CHANNEL channel)
void PLIB_USART_TransmitterByteSend(USART_MODULE_ID index, int8_t data)
void SYS_PORTS_RemapOutput(PORTS_MODULE_ID index, PORTS_REMAP_OUTPUT_FUNCTION function, PORTS_REMAP_OUTPUT_PIN remapPin)
bool PLIB_DMA_ExistsChannelXSourceStartAddress(DMA_MODULE_ID index)
bool PLIB_USART_ReceiverFramingErrorHasOccurred(USART_MODULE_ID index)
void PLIB_DMA_AbortTransferSet(DMA_MODULE_ID index, DMA_CHANNEL channel)
bool PLIB_PORTS_ExistsPinModePerPort(PORTS_MODULE_ID index)
void SYS_PORTS_ChangeNotificationGlobalEnable(PORTS_MODULE_ID index)
DRV_TMR_CLK_SOURCES
bool PLIB_DMA_ExistsChannelXStartIRQ(DMA_MODULE_ID index)
uint8_t Get_CRC_Value(void)
Definition: crc.c:157
void qqqtotalreset(void)
Definition: inszt_main.c:7067
SYS_DMA_ERROR SYS_DMA_ChannelErrorGet(SYS_DMA_CHANNEL_HANDLE handle)
uint16_t current
Definition: cf.h:100
void PLIB_USART_AddressSet(USART_MODULE_ID index, uint8_t address)
void DRV_USART0_Close(void)
bool PLIB_PORTS_ExistsChangeNoticePerPortTurnOn(PORTS_MODULE_ID index)
bool PLIB_SPI_ExistsFrameErrorStatus(SPI_MODULE_ID index)
static void Decode_Manchester(void)
void PLIB_PORTS_ChangeNoticeInIdlePerPortEnable(PORTS_MODULE_ID index, PORTS_CHANNEL channel)
void PLIB_PORTS_PinToggle(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
void DRV_TMR4_CounterValueSet(uint32_t value)
void SYS_PORTS_ChangeNotificationPullUpEnable(PORTS_MODULE_ID index, PORTS_CHANGE_NOTICE_PIN pinNum)
bool PLIB_PORTS_ExistsPortsOpenDrain(PORTS_MODULE_ID index)
void SYS_PORTS_ChangeNotificationDisable(PORTS_MODULE_ID index, PORTS_CHANGE_NOTICE_PIN pinNum)
DRV_USART_HANDSHAKE
Definition: inszt_adc.c:15241
DRV_SPI_MODE
Definition: inszt_adc.c:26421
void PLIB_USART_ReceiverAddressDetectEnable(USART_MODULE_ID index)
DRV_SPI_BUFFER_TYPE bufferType
Definition: inszt_adc.c:26574
uintptr_t DRV_USART_BUFFER_HANDLE
#define commands_65zzopen
size_t DRV_USART_BufferProcessedSizeGet(DRV_USART_BUFFER_HANDLE bufferHandle)
void PLIB_USART_RunInSleepModeDisable(USART_MODULE_ID index)
bool PLIB_DMA_ExistsChannelXPatternIgnore(DMA_MODULE_ID index)
void PLIB_PORTS_CnPinsPullUpEnable(PORTS_MODULE_ID index, PORTS_CN_PIN cnPins)
bool DRV_TMR4_ClockSet(DRV_TMR_CLK_SOURCES clockSource, TMR_PRESCALE prescale)
void SYS_DMA_ChannelTransferAdd(SYS_DMA_CHANNEL_HANDLE handle, const void *srcAddr, size_t srcSize, const void *destAddr, size_t destSize, size_t cellSize)
static void Send_Space(void)
void DRV_TMR2_Initialize(void)
static void Execute_Auto_Protocol_A(void)
void PLIB_USART_AddressMaskSet(USART_MODULE_ID index, uint8_t mask)
static SYS_STATUS DRV_TMR0_Status(void)
void PLIB_SPI_StopInIdleDisable(SPI_MODULE_ID index)
void DRV_TMR0_StopInIdleDisable(void)
int QQQindicator
Definition: inszt_main.c:104
PREAMBLE_STATES
CF_STATES
Definition: cf.h:68
bool PLIB_SPI_ExistsReceiveFIFOStatus(SPI_MODULE_ID index)
static char qqqqone[]
static int qqqqbmselwidth
unsigned int DRV_USART_TransmitBufferSizeGet(const DRV_HANDLE handle)
bool PLIB_DMA_ExistsCRCBitOrder(DMA_MODULE_ID index)
uint32_t DRV_IC0_Capture32BitDataRead(void)
bool PLIB_USART_ExistsReceiverAddressAutoDetect(USART_MODULE_ID index)
void PLIB_USART_TransmitterInterruptModeSelect(USART_MODULE_ID index, USART_TRANSMIT_INTR_MODE fifolevel)
SYSTEM_OBJECTS sysObj
size_t DRV_USART_BufferCompletedBytesGet(DRV_USART_BUFFER_HANDLE bufferHandle)
void DRV_TMR4_StopInIdleDisable(void)
void PLIB_DMA_StopInIdleEnable(DMA_MODULE_ID index)
uint32_t DRV_TMR3_CounterFrequencyGet(void)
DRV_USART_CLIENT_STATUS
Definition: inszt_adc.c:15464
bool PLIB_PORTS_ExistsChangeNoticePullUpPerPort(PORTS_MODULE_ID index)
void PLIB_SPI_SlaveSelectDisable(SPI_MODULE_ID index)
void PLIB_PORTS_AnPinsModeSelect(PORTS_MODULE_ID index, PORTS_AN_PIN anPins, PORTS_PIN_MODE mode)
void DRV_IC0_Initialize(void)
void(* SYS_DMA_CHANNEL_TRANSFER_EVENT_HANDLER)(SYS_DMA_TRANSFER_EVENT event, SYS_DMA_CHANNEL_HANDLE handle, uintptr_t contextHandle)
bool PLIB_USART_TransmitterIsEmpty(USART_MODULE_ID index)
WL_CPS_DATA WL_CPS
Definition: wl_cps.c:56
void PLIB_PORTS_PinOpenDrainEnable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
DRV_HANDLE spi_cont_pot
Definition: inszt_app.c:28635
uint32_t PORTS_DATA_TYPE
void DRV_USART0_TasksError(void)
bool PLIB_SPI_TransmitBufferIsEmpty(SPI_MODULE_ID index)
static SYS_STATUS DRV_TMR4_Status(void)
static void DRV_TMR3_Open(void)
DOWN_MSG DWNMSG
Definition: fsk.c:69
DRV_IO_INTENT
Definition: inszt_adc.c:975
size_t DRV_USART_Write(const DRV_HANDLE handle, void *buffer, const size_t numbytes)
DRV_SPI_BUFFER_EVENT_HANDLER operationStarting
Definition: inszt_adc.c:26603
void PLIB_USART_Disable(USART_MODULE_ID index)
bool DRV_TMR2_Start(void)
uint16_t DRV_IC0_Capture16BitDataRead(void)
void PLIB_USART_ReceiverOverrunErrorClear(USART_MODULE_ID index)
TMR_PRESCALE DRV_TMR0_PrescalerGet(void)
void PLIB_SPI_TransmitUnderRunStatusClear(SPI_MODULE_ID index)
uint16_t PLIB_DMA_ChannelXDestinationPointerGet(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel)
bool PLIB_SPI_ExistsFrameSyncPulsePolarity(SPI_MODULE_ID index)
void DRV_TMR_AlarmEnable(DRV_HANDLE handle, bool enable)
void SYS_DMA_ChannelEnable(SYS_DMA_CHANNEL_HANDLE handle)
static void Send_Message_Tasks(void)
FSK_DATA FSK
Definition: fsk.c:71
void PLIB_DMA_ChannelXNullWriteModeDisable(DMA_MODULE_ID index, DMA_CHANNEL channel)
void SYS_DEBUG_ErrorLevelSet(SYS_ERROR_LEVEL level)
void SYS_DMA_TasksError(SYS_MODULE_OBJ object)
void(* DRV_TMR_CALLBACK)(uintptr_t context, uint32_t alarmCount)
static int QQQfirstmcdc
bool PLIB_DMA_ExistsSuspend(DMA_MODULE_ID index)
bool PLIB_DMA_ExistsChannelXDisabled(DMA_MODULE_ID index)
void PLIB_SPI_PinEnable(SPI_MODULE_ID index, SPI_PIN pin)
uint32_t PLIB_DMA_RecentAddressAccessed(DMA_MODULE_ID index)
void PLIB_DMA_ChannelXOperatingTransferModeSelect(DMA_MODULE_ID index, DMA_CHANNEL channel, DMA_TRANSFER_MODE channeltransferMode)
Definition: fsk.h:170
static void MAN_PROCESS_Tasks(void)
int32_t DRV_SPI_ClientConfigure(DRV_HANDLE handle, const DRV_SPI_CLIENT_DATA *cfgData)
void PLIB_DMA_ChannelXStartIRQSet(DMA_MODULE_ID index, DMA_CHANNEL channel, DMA_TRIGGER_SOURCE IRQnum)
bool PLIB_USART_ReceiverIsIdle(USART_MODULE_ID index)
void PLIB_DMA_CRCWriteByteOrderAlter(DMA_MODULE_ID index)
bool DRV_TMR2_ClockSet(DRV_TMR_CLK_SOURCES clockSource, TMR_PRESCALE prescale)
bool PLIB_DMA_ExistsChannelXBusy(DMA_MODULE_ID index)
bool PLIB_DMA_ExistsCRCType(DMA_MODULE_ID index)
bool PLIB_DMA_ExistsChannelXDestinationPointer(DMA_MODULE_ID index)
bool PLIB_SPI_ExistsAudioErrorControl(SPI_MODULE_ID index)
void qqqtotalupload(void)
Definition: inszt_main.c:7054
static void store_switches(void)
static int qqqstructzzopen
DRV_USART_HANDSHAKE
SYS_MODULE_OBJ SYS_DEBUG_Initialize(const SYS_MODULE_INDEX index, const SYS_MODULE_INIT *const init)
SYS_DMA_CHANNEL_OP_MODE
Definition: inszt_adc.c:13381
bool PLIB_DMA_ExistsAbortTransfer(DMA_MODULE_ID index)
bool PLIB_PORTS_ExistsPortsDirection(PORTS_MODULE_ID index)
SPI_FRAME_PULSE_EDGE framePulseEdge
Definition: inszt_adc.c:26555
bool PLIB_SPI_ExistsAudioProtocolMode(SPI_MODULE_ID index)
void PLIB_DMA_BusyActiveReset(DMA_MODULE_ID index)
bool PLIB_USART_ExistsReceiverIdleStatus(USART_MODULE_ID index)
void PLIB_PORTS_ChangeNoticePullUpPerPortDisable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
void PLIB_DMA_ChannelXSourceSizeSet(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel, uint16_t sourceSize)
DRV_SPI_TASK_MODE
void PLIB_DMA_ChannelXAutoDisable(DMA_MODULE_ID index, DMA_CHANNEL channel)
void DRV_ADC_Stop(void)
void PLIB_DMA_ChannelXAutoEnable(DMA_MODULE_ID index, DMA_CHANNEL channel)
SPI_MODULE_ID spiId
Definition: inszt_adc.c:26537
static const uint8_t Xmit11[312]
static void qqoutput4(FILEPOINT char *s, int i, int j, int k, int l)
MAN_STATES
Definition: inszt_app.c:29350
bool PLIB_USART_ExistsEnable(USART_MODULE_ID index)
Definition: fsk.h:217
bool PLIB_USART_ExistsModuleBusyStatus(USART_MODULE_ID index)
bool PLIB_SPI_ExistsErrorInterruptControl(SPI_MODULE_ID index)
SYS_DMA_TRANSFER_EVENT
void PLIB_PORTS_Toggle(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_MASK toggleMask)
void SYS_DMA_ChannelResume(SYS_DMA_CHANNEL_HANDLE handle)
DRV_HANDLE spi_bias_fsk
Definition: inszt_app.c:29445
TMR_PRESCALE DRV_TMR1_PrescalerGet(void)
void WL_CPS_Tasks(void)
void PLIB_PORTS_PinOpenDrainDisable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
static void Execute_System(void)
uint16_t PORTS_DATA_MASK
bool PLIB_USART_ExistsTransmitterEnable(USART_MODULE_ID index)
TMR_PRESCALE DRV_TMR4_PrescalerGet(void)
void DRV_IC0_Stop(void)
S5_COMMAND
bool PLIB_DMA_ChannelXAutoIsEnabled(DMA_MODULE_ID index, DMA_CHANNEL channel)
bool PLIB_DMA_ChannelXCollisionStatus(DMA_MODULE_ID index, DMA_CHANNEL channel, DMA_CHANNEL_COLLISION collisonType)
WL_CPS_STATES
bool PLIB_USART_ExistsReceiverDataAvailableStatus(USART_MODULE_ID index)
void PLIB_PORTS_ChannelChangeNoticePullDownDisable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_MASK mask)
static void qqoutput2(FILEPOINT char *s, int i, int j)
SYS_DMA_ERROR
uint32_t DRV_IC_Capture32BitDataRead(DRV_HANDLE handle)
float float32_t
static DRV_TMR_OPERATION_MODE DRV_TMR2_OperationModeGet(void)
bool SYS_DMA_IsBusy(void)
uint16_t PLIB_DMA_ChannelXSourceSizeGet(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel)
SYS_ERROR_LEVEL
Definition: inszt_adc.c:17548
uint32_t DRV_TMR_CounterValueGet(DRV_HANDLE handle)
bool PLIB_SPI_ReadDataIsSignExtended(SPI_MODULE_ID index)
S3_COMMAND S3_state
Definition: inszt_app.c:27774
uintptr_t DRV_USART_BUFFER_HANDLE
Definition: inszt_adc.c:15035
void PLIB_DMA_ChannelXChainEnable(DMA_MODULE_ID index, DMA_CHANNEL channel)
DRV_USART_CLIENT_STATUS DRV_USART0_ClientStatus(void)
void PLIB_DMA_ChannelXDataSizeSelect(DMA_MODULE_ID index, DMA_CHANNEL channel, DMA_CHANNEL_DATA_SIZE channelDataSize)
static void qqbmsoutput(FILEPOINT char *s, unsigned int i)
void SYS_DMA_Tasks(SYS_MODULE_OBJ object, DMA_CHANNEL activeChannel)
Definition: fsk.h:78
bool DRV_TMR3_Start(void)
uint32_t DRV_TMR4_CounterFrequencyGet(void)
DRV_IO_BUFFER_TYPES
SWITCH_STATES
void DRV_TMR_CounterValueSet(DRV_HANDLE handle, uint32_t counterPeriod)
void PLIB_USART_BaudRateSet(USART_MODULE_ID index, uint32_t clockFrequency, uint32_t baudRate)
void DRV_TMR0_PeriodValueSet(uint32_t value)
bool PLIB_SPI_ExistsEnableControl(SPI_MODULE_ID index)
void SYS_PORTS_PinDirectionSelect(PORTS_MODULE_ID index, SYS_PORTS_PIN_DIRECTION pinDir, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
void PLIB_PORTS_ChannelChangeNoticeMethodSelect(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_CHANGE_NOTICE_METHOD changeNoticeMethod)
void PLIB_PORTS_ChangeNoticePullUpDisable(PORTS_MODULE_ID index, PORTS_CHANGE_NOTICE_PIN pinNum)
void PLIB_DMA_ChannelXPatternIgnoreSet(DMA_MODULE_ID index, DMA_CHANNEL channel, uint8_t pattern)
MSG_STATES
void PLIB_USART_LoopbackEnable(USART_MODULE_ID index)
void PLIB_SPI_FIFODisable(SPI_MODULE_ID index)
bool DRV_ADC_SamplesAvailable(uint8_t bufIndex)
void PLIB_PORTS_PinDirectionInputSet(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
bool PLIB_DMA_ExistsCRCData(DMA_MODULE_ID index)
DRV_HANDLE DRV_SPI_Open(const SYS_MODULE_INDEX drvIndex, const DRV_IO_INTENT ioIntent)
void PLIB_SPI_SlaveSelectEnable(SPI_MODULE_ID index)
bool PLIB_SPI_ExistsBaudRateClock(SPI_MODULE_ID index)
void PLIB_DMA_ChannelXINTSourceFlagSet(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel, DMA_INT_TYPE dmaINTSource)
void APP_Initialize(void)
Definition: app.c:93
uint16_t current
Definition: inszt_app.c:28641
DRV_SPI_BUFFER_EVENT_HANDLER operationEnded
Definition: inszt_adc.c:26610
DRV_SPI_PROTOCOL_TYPE
uint32_t DRV_TMR_AlarmPeriodGet(DRV_HANDLE handle)
void PLIB_DMA_ChannelXPatternIgnoreByteEnable(DMA_MODULE_ID index, DMA_CHANNEL channel)
bool PLIB_USART_ExistsReceiverAddressMask(USART_MODULE_ID index)
void * PLIB_USART_ReceiverAddressGet(USART_MODULE_ID index)
void PLIB_DMA_ChannelXDestinationSizeSet(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel, uint16_t destinationSize)
CLK_BUSES_PERIPHERAL spiClk
Definition: inszt_adc.c:26570
void HVPS_Tasks(void)
Definition: hvps.c:117
void(* ldra_void_function)()
DRV_TMR_CLIENT_STATUS DRV_TMR0_ClientStatus(void)
void DRV_USART_ByteReceiveCallbackSet(const SYS_MODULE_INDEX index, const DRV_USART_BYTE_EVENT_HANDLER eventHandler)
uint8_t DRV_PMP0_Read(void)
DRV_ADC_MODULE_ID
void Generate_Sine_Wave_Data(float32_t NoOfTicks)
Definition: fsk.c:501
void PLIB_SPI_PinDisable(SPI_MODULE_ID index, SPI_PIN pin)
uint16_t PLIB_DMA_ChannelXPatternDataGet(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel)
bool PLIB_SPI_ExistsFIFOShiftRegisterEmptyStatus(SPI_MODULE_ID index)
void COMMAND_Tasks(void)
SYS_DMA_CRC_WRITE_ORDER
static DRV_TMR_OPERATION_MODE DRV_TMR1_OperationModeGet(void)
DRV_SPI_BUFFER_TYPE
static void Check_WL_CPS_Over_Current(void)
void PLIB_SPI_SlaveEnable(SPI_MODULE_ID index)
void PLIB_USART_InitializeOperation(USART_MODULE_ID index, USART_RECEIVE_INTR_MODE receiveInterruptMode, USART_TRANSMIT_INTR_MODE transmitInterruptMode, USART_OPERATION_MODE operationMode)
void DRV_TMR4_CounterClear(void)
void PLIB_SPI_BufferWrite(SPI_MODULE_ID index, uint8_t data)
uint8_t PLIB_SPI_FIFOCountGet(SPI_MODULE_ID index, SPI_FIFO_TYPE type)
void PLIB_SPI_FramedCommunicationEnable(SPI_MODULE_ID index)
unsigned int DRV_USART0_ReceiverBufferSizeGet(void)
SPI_COMMUNICATION_WIDTH commWidth
Definition: inszt_adc.c:26563
void PLIB_USART_RunInSleepModeEnable(USART_MODULE_ID index)
bool PLIB_USART_ExistsReceiver9Bits(USART_MODULE_ID index)
void DRV_USART_Deinitialize(SYS_MODULE_OBJ object)
void PLIB_SPI_OutputDataPhaseSelect(SPI_MODULE_ID index, SPI_OUTPUT_DATA_PHASE phase)
DRV_SPI_BUFFER_HANDLE DRV_SPI_BufferAddRead2(DRV_HANDLE handle, void *rxBuffer, size_t size, DRV_SPI_BUFFER_EVENT_HANDLER completeCB, void *context, DRV_SPI_BUFFER_HANDLE *jobHandle)
void PLIB_PORTS_ChangeNoticeDisable(PORTS_MODULE_ID index)
bool DRV_TMR0_Start(void)
bool PLIB_SPI_ExistsBaudRate(SPI_MODULE_ID index)
uint8_t RevNumber
Definition: app.h:61
void SYS_DMA_ChannelSetup(SYS_DMA_CHANNEL_HANDLE handle, SYS_DMA_CHANNEL_OP_MODE modeEnable, DMA_TRIGGER_SOURCE eventSrc)
TMultiValue MESSAGE
Definition: fsk.c:70
void PLIB_PORTS_RemapInput(PORTS_MODULE_ID index, PORTS_REMAP_INPUT_FUNCTION inputFunction, PORTS_REMAP_INPUT_PIN remapInputPin)
bool PLIB_SPI_ExistsFrameSyncPulseCounter(SPI_MODULE_ID index)
uint32_t DRV_TMR_CounterFrequencyGet(DRV_HANDLE handle)
void PLIB_USART_TransmitterDisable(USART_MODULE_ID index)
void DRV_TMR_Tasks(SYS_MODULE_OBJ object)
bool PLIB_PORTS_ExistsChangeNoticeEdgeControl(PORTS_MODULE_ID index)
void PLIB_SPI_FrameSyncPulseEdgeSelect(SPI_MODULE_ID index, SPI_FRAME_PULSE_EDGE edge)
bool DRV_TMR3_ClockSet(DRV_TMR_CLK_SOURCES clockSource, TMR_PRESCALE prescale)
void PLIB_DMA_ChannelXBusyActiveSet(DMA_MODULE_ID index, DMA_CHANNEL channel)
MAN_PROCESS_STATES
bool PLIB_DMA_ExistsCRCAppendMode(DMA_MODULE_ID index)
bool PLIB_SPI_ExistsTransmitUnderRunStatus(SPI_MODULE_ID index)
bool spi_sent_flag
Definition: inszt_app.c:29419
void PLIB_PORTS_PinChangeNoticePerPortEnable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
uint8_t command[7]
Definition: commands.h:77
static void DRV_TMR3_DeInitialize(void)
void SYS_PORTS_PinPullDownDisable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
DRV_USART_CLIENT_STATUS DRV_USART_ClientStatus(DRV_HANDLE handle)
bool PLIB_PORTS_ExistsPinChangeNotice(PORTS_MODULE_ID index)
uint32_t PORTS_DATA_TYPE
Definition: inszt_adc.c:18532
DRV_SPI_MODE
void PLIB_DMA_Disable(DMA_MODULE_ID index)
MAN_STATES
DRV_USART_OPERATION_MODE
Definition: inszt_adc.c:15059
bool PLIB_DMA_ExistsChannelX(DMA_MODULE_ID index)
void SYS_DMA_TasksErrorISR(SYS_MODULE_OBJ object, DMA_CHANNEL activeChannel)
S1_COMMAND
Definition: inszt_app.c:27739
DRV_USART_ERROR
Definition: inszt_adc.c:15426
bool PLIB_SPI_TransmitBufferIsFull(SPI_MODULE_ID index)
HVPS_STATES
Definition: hvps.h:54
static void DRV_TMR2_DeInitialize(void)
bool PLIB_DMA_LastBusAccessIsRead(DMA_MODULE_ID index)
DRV_HANDLE DRV_TMR_Open(const SYS_MODULE_INDEX index, const DRV_IO_INTENT intent)
void PLIB_PORTS_ChannelSlewRateSelect(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_MASK channelMask, PORTS_PIN_SLEW_RATE slewRate)
void PLIB_SPI_BufferClear(SPI_MODULE_ID index)
void PLIB_USART_StopInIdleEnable(USART_MODULE_ID index)
uint8_t queueSize
Definition: inszt_adc.c:26592
bool PLIB_SPI_ExistsTransmitBufferFullStatus(SPI_MODULE_ID index)
void PLIB_DMA_ChannelXPrioritySelect(DMA_MODULE_ID index, DMA_CHANNEL channel, DMA_CHANNEL_PRIORITY channelPriority)
CF_DATA CF
Definition: cf.c:59
static void DRV_TMR0_Tasks(void)
bool PLIB_SPI_ExistsFramedCommunication(SPI_MODULE_ID index)
int qqqshell_upload
Definition: inszt_main.c:150
uint32_t DRV_TMR2_PeriodValueGet(void)
bool PLIB_DMA_ExistsCRCXOREnable(DMA_MODULE_ID index)
SYS_PORTS_PULLUP_PULLDOWN_STATUS
Definition: inszt_adc.c:21864
bool PLIB_PORTS_ExistsChangeNoticeInIdle(PORTS_MODULE_ID index)
void PLIB_PORTS_ChannelChangeNoticePullUpEnable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_MASK mask)
bool PLIB_USART_ExistsBaudRateAutoDetect(USART_MODULE_ID index)
void DRV_TMR3_StopInIdleEnable(void)
void PLIB_SPI_Enable(SPI_MODULE_ID index)
void PLIB_USART_ReceiverDisable(USART_MODULE_ID index)
uint8_t PLIB_USART_AddressMaskGet(USART_MODULE_ID index)
DRV_USART_TRANSFER_STATUS
void SYS_PORTS_PinPullDownEnable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
void PLIB_USART_BaudRateHighSet(USART_MODULE_ID index, uint32_t clockFrequency, uint32_t baudRate)
bool PLIB_PORTS_ExistsChannelChangeNoticeMethod(PORTS_MODULE_ID index)
void MAN_Tasks(void)
Definition: inszt_man.c:29645
void PLIB_SPI_MasterEnable(SPI_MODULE_ID index)
void PLIB_PORTS_OpenDrainEnable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_MASK mask)
uint8_t Calc_CRC_Uplink(uint16_t Count, const uint8_t Bytes [])
Definition: crc.c:116
void Adjust_WL_CPS_Voltage(uint8_t target)
void DRV_TMR2_Stop(void)
DMA_DESTINATION_ADDRESSING_MODE PLIB_DMA_ChannelXDestinationAddressModeGet(DMA_MODULE_ID index, DMA_CHANNEL channel)
uint8_t Calc_CRC_Array(uint16_t Count, const uint8_t Bytes [])
Definition: crc.c:92
static void DRV_TMR4_Close(void)
PRE_DATA PRE_MSG
Definition: fsk.c:73
uint16_t PLIB_DMA_ChannelXDestinationSizeGet(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel)
bool PLIB_PORTS_ExistsChangeNoticePullDownPerPort(PORTS_MODULE_ID index)
void DRV_IC0_Start(void)
static float32_t Calc_Fsk_Scaling(void)
DMA_CHANNEL_ADDRESSING_MODE PLIB_DMA_ChannelXAddressModeGet(DMA_MODULE_ID index, DMA_CHANNEL channel)
SYS_ERROR_LEVEL SYS_DEBUG_ErrorLevelGet(void)
void DRV_TMR_CounterClear(DRV_HANDLE handle)
bool PLIB_SPI_ExistsFrameSyncPulseEdge(SPI_MODULE_ID index)
SYS_STATUS SYS_DEBUG_Status(SYS_MODULE_OBJ object)
DRV_TMR_CLIENT_STATUS DRV_TMR4_ClientStatus(void)
bool PLIB_USART_ExistsReceiverOverrunStatus(USART_MODULE_ID index)
uint16_t voltage
Definition: inszt_app.c:28452
DRV_SPI_BUFFER_EVENT_HANDLER operationEnded
Definition: inszt_adc.c:26642
uint16_t DRV_IC_Capture16BitDataRead(DRV_HANDLE handle)
DRV_TMR_CLIENT_STATUS DRV_TMR3_ClientStatus(void)
void DRV_USART_TasksReceive(SYS_MODULE_OBJ object)
bool GetDepthStatus(void)
bool PLIB_DMA_ExistsChannelXPatternIgnoreByte(DMA_MODULE_ID index)
void DRV_TMR_AlarmDeregister(DRV_HANDLE handle)
void PLIB_PORTS_ChangeNoticeInIdlePerPortDisable(PORTS_MODULE_ID index, PORTS_CHANNEL channel)
bool DRV_IC_BufferIsEmpty(DRV_HANDLE handle)
void DRV_TMR3_PeriodValueSet(uint32_t value)
void DRV_USART_BufferAddWrite(const DRV_HANDLE handle, DRV_USART_BUFFER_HANDLE *bufferHandle, void *buffer, const size_t size)
static void qqoutput(FILEPOINT char *s, int i)
void PLIB_SPI_AudioTransmitModeSelect(SPI_MODULE_ID index, SPI_AUDIO_TRANSMIT_MODE mode)
DRV_USART_TRANSFER_STATUS DRV_USART_TransferStatus(const DRV_HANDLE handle)
uint8_t PLIB_SPI_BufferRead(SPI_MODULE_ID index)
void DRV_TMR3_StopInIdleDisable(void)
bool PLIB_DMA_ChannelXReloadIsEnabled(DMA_MODULE_ID index, DMA_CHANNEL channel)
bool spiSlaveSSPin
Definition: inszt_adc.c:26547
DRV_SPI_BUFFER_HANDLE DRV_SPI_BufferAddWriteRead(DRV_HANDLE handle, void *txBuffer, size_t txSize, void *rxBuffer, size_t rxSize, DRV_SPI_BUFFER_EVENT_HANDLER completeCB, void *context)
bool PLIB_PORTS_ExistsChangeNoticePerPortInIdle(PORTS_MODULE_ID index)
DRV_TMR_OPERATION_MODE DRV_TMR_DividerRangeGet(DRV_HANDLE handle, DRV_TMR_DIVIDER_RANGE *pDivRange)
S1_COMMAND
static int commands_65zqqzqz(qqnull_params)
void Prepare_Dwn_Msg(uint8_t Identifier, uint8_t Cmd, uint8_t Msg_Length)
Definition: fsk.c:227
PORTS_DATA_TYPE SYS_PORTS_InterruptStatusGet(PORTS_MODULE_ID index, PORTS_CHANNEL channel)
bool PLIB_USART_ExistsLoopback(USART_MODULE_ID index)
SYS_DMA_CHANNEL_CRC_MODE
COMMAND_STATES state
Definition: commands.h:73
DRV_USART_ERROR DRV_USART0_ErrorGet(void)
bool DRV_USART0_TransmitBufferIsFull(void)
uint32_t DRV_TMR2_CounterValueGet(void)
void DRV_PMP0_ModeConfig(void)
DRV_USART_BUFFER_EVENT
Definition: inszt_adc.c:15096
DRV_USART_BUFFER_RESULT DRV_USART_BufferRemove(DRV_USART_BUFFER_HANDLE bufferHandle)
DRV_TMR_CLIENT_STATUS DRV_TMR_ClientStatus(DRV_HANDLE handle)
void PLIB_PORTS_ChannelChangeNoticeEdgeEnable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_MASK edgeRisingMask, PORTS_DATA_MASK edgeFallingMask)
DRV_SPI_CLOCK_MODE
Definition: inszt_adc.c:26299
static void DRV_TMR0_DeInitialize(void)
void PLIB_DMA_ChannelXReloadDisable(DMA_MODULE_ID index, DMA_CHANNEL channel)
uint16_t PLIB_DMA_ChannelXCellProgressPointerGet(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel)
SYS_MODULE_OBJ SYS_DMA_Initialize(const SYS_MODULE_INIT *const init)
static DRV_TMR_OPERATION_MODE DRV_TMR4_OperationModeGet(void)
bool PLIB_USART_ExistsTransmitter9BitsSend(USART_MODULE_ID index)
bool PLIB_DMA_ExistsBusy(DMA_MODULE_ID index)
void PLIB_SPI_ClockPolaritySelect(SPI_MODULE_ID index, SPI_CLOCK_POLARITY polarity)
struct _DRV_SPI_CLIENT_DATA DRV_SPI_CLIENT_DATA
bool DRV_TMR_ClockSet(DRV_HANDLE handle, DRV_TMR_CLK_SOURCES clockSource, TMR_PRESCALE preScale)
bool PLIB_DMA_CRCAppendModeIsEnabled(DMA_MODULE_ID index)
PORTS_DATA_TYPE PLIB_PORTS_Read(PORTS_MODULE_ID index, PORTS_CHANNEL channel)
bool PLIB_USART_ExistsReceiverInterruptMode(USART_MODULE_ID index)
void DRV_SPI_Tasks(SYS_MODULE_OBJ object)
void DRV_USART_ByteErrorCallbackSet(const SYS_MODULE_INDEX index, const DRV_USART_BYTE_EVENT_HANDLER eventHandler)
static void DRV_TMR1_Close(void)
void DRV_TMR0_StopInIdleEnable(void)
bool PLIB_SPI_ExistsReceiveBufferStatus(SPI_MODULE_ID index)
DRV_USART_INIT_FLAGS
Definition: inszt_adc.c:15364
bool PLIB_SPI_ExistsBuffer(SPI_MODULE_ID index)
SYS_DMA_CHANNEL_OP_MODE
void PLIB_SPI_FrameSyncPulsePolaritySelect(SPI_MODULE_ID index, SPI_FRAME_PULSE_POLARITY polarity)
void PLIB_DMA_ChannelXChainToHigher(DMA_MODULE_ID index, DMA_CHANNEL channel)
SYS_DMA_CRC_WRITE_ORDER
Definition: inszt_adc.c:13358
void PLIB_DMA_ChannelXDisable(DMA_MODULE_ID index, DMA_CHANNEL channel)
COMMAND_STATES
MSG_DATA MSG
Definition: fsk.c:72
bool PLIB_SPI_ExistsClockPolarity(SPI_MODULE_ID index)
static void qqoutput3(FILEPOINT char *s, int i, int j, int k)
void DRV_USART_TasksTransmit(SYS_MODULE_OBJ object)
void DRV_TMR2_CounterValueSet(uint32_t value)
bool DRV_TMR0_ClockSet(DRV_TMR_CLK_SOURCES clockSource, TMR_PRESCALE prescale)
uint16_t adj[1]
Definition: inszt_app.c:29448
void DRV_TMR2_CounterClear(void)
void DRV_TMR1_PeriodValueSet(uint32_t value)
uint16_t offset
Definition: inszt_app.c:28463
void PLIB_PORTS_ChannelModeSelect(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_MASK modeMask, PORTS_PIN_MODE mode)
bool PLIB_USART_ExistsLineControlMode(USART_MODULE_ID index)
static void DRV_TMR4_DeInitialize(void)
void DRV_USART_WriteByte(const DRV_HANDLE handle, const uint8_t byte)
void DRV_USART_TasksError(SYS_MODULE_OBJ object)
DRV_HANDLE DRV_USART_Open(const SYS_MODULE_INDEX index, const DRV_IO_INTENT ioIntent)
SYS_DMA_SIDL
void DRV_ADC_Start(void)
void DRV_TMR2_StopInIdleEnable(void)
uint16_t current_array[5]
Definition: inszt_app.c:28654
SPI_INPUT_SAMPLING_PHASE inputSamplePhase
Definition: inszt_adc.c:26578
PREAMBLE_STATES
Definition: fsk.h:191
void SYS_PORTS_DirectionSelect(PORTS_MODULE_ID index, SYS_PORTS_PIN_DIRECTION pinDir, PORTS_CHANNEL channel, PORTS_DATA_MASK mask)
void PLIB_PORTS_ChannelChangeNoticeEdgeDisable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_MASK edgeRisingMask, PORTS_DATA_MASK edgeFallingMask)
SYS_ERROR_LEVEL gblErrLvl
unsigned int DRV_USART0_TransmitBufferSizeGet(void)
void PLIB_PORTS_Write(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_TYPE value)
DRV_SPI_BUFFER_EVENT_HANDLER operationStarting
Definition: inszt_adc.c:26635
void PLIB_SPI_BaudRateSet(SPI_MODULE_ID index, uint32_t clockFrequency, uint32_t baudRate)
void SYS_DEBUG_Tasks(SYS_MODULE_OBJ object)
bool DRV_TMR_Start(DRV_HANDLE handle)
void SYS_DEBUG_Deinitialize(SYS_MODULE_OBJ object)
void PLIB_DMA_ChannelXINTSourceEnable(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel, DMA_INT_TYPE dmaINTSource)
void PLIB_SPI_AudioProtocolDisable(SPI_MODULE_ID index)
void PLIB_SPI_InputSamplePhaseSelect(SPI_MODULE_ID index, SPI_INPUT_SAMPLING_PHASE phase)
void PLIB_USART_ReceiverEnable(USART_MODULE_ID index)
void Prepare_Return_A(uint8_t byte, uint16_t data2, uint16_t data1)
void PLIB_USART_TransmitterIdleIsLowDisable(USART_MODULE_ID index)
void PLIB_DMA_StopInIdleDisable(DMA_MODULE_ID index)
bool PLIB_DMA_ExistsCRCByteOrder(DMA_MODULE_ID index)
DMA_CRC_TYPE PLIB_DMA_CRCTypeGet(DMA_MODULE_ID index)
HVPS_DATA HV_PS
Definition: hvps.c:56
void PLIB_SPI_FrameSyncPulseCounterSelect(SPI_MODULE_ID index, SPI_FRAME_SYNC_PULSE pulse)
void SYS_PORTS_OpenDrainDisable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_MASK mask)
void PLIB_DMA_SuspendDisable(DMA_MODULE_ID index)
bool PLIB_DMA_ChannelXBufferedDataIsWritten(DMA_MODULE_ID index, DMA_CHANNEL channel)
static void Read_WL_CPS_V_I(void)
CF_STATES
bool PLIB_USART_ExistsBaudRateHigh(USART_MODULE_ID index)
SWITCH_STATES
Definition: inszt_app.c:27636
static const uint8_t Xmit00[168]
void PLIB_SPI_FIFOEnable(SPI_MODULE_ID index)
DRV_USART_BAUD_SET_RESULT DRV_USART0_BaudSet(uint32_t baud)
bool PLIB_SPI_Exists16bitBuffer(SPI_MODULE_ID index)
void PLIB_SPI_Disable(SPI_MODULE_ID index)
void SYS_DMA_ChannelSuspend(SYS_DMA_CHANNEL_HANDLE handle)
PORTS_DATA_MASK PLIB_PORTS_DirectionGet(PORTS_MODULE_ID index, PORTS_CHANNEL channel)
SPI_AUDIO_TRANSMIT_MODE audioTransmitMode
Definition: inszt_adc.c:26559
void PLIB_DMA_ChannelXBusyInActiveSet(DMA_MODULE_ID index, DMA_CHANNEL channel)
PORTS_DATA_TYPE SYS_PORTS_Read(PORTS_MODULE_ID index, PORTS_CHANNEL channel)
static void Test_Manchester(void)
bool PLIB_USART_ExistsReceiverIdleStateLowEnable(USART_MODULE_ID index)
DRV_USART_BAUD_SET_RESULT
uintptr_t DRV_SPI_BUFFER_HANDLE
Definition: inszt_adc.c:26247
void DRV_ADC_DeInitialize(void)
DRV_TMR_OPERATION_MODE DRV_TMR4_DividerRangeGet(DRV_TMR_DIVIDER_RANGE *pDivRange)
void PLIB_USART_ReceiverInterruptModeSelect(USART_MODULE_ID index, USART_RECEIVE_INTR_MODE interruptMode)
void SYS_PORTS_Clear(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_MASK clearMask)
DRV_USART_ERROR DRV_USART_ErrorGet(const DRV_HANDLE client)
void DRV_TMR2_PeriodValueSet(uint32_t value)
void PLIB_PORTS_PinModePerPortSelect(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos, PORTS_PIN_MODE mode)
bool PLIB_DMA_ExistsChannelXTrigger(DMA_MODULE_ID index)
SPI_AUDIO_PROTOCOL audioProtocolMode
Definition: inszt_adc.c:26561
void PLIB_DMA_CRCBitOrderSelect(DMA_MODULE_ID index, DMA_CRC_BIT_ORDER bitOrder)
void PLIB_DMA_ChannelXPeripheralAddressSet(DMA_MODULE_ID index, DMA_CHANNEL channel, uint16_t peripheraladdress)
bool PLIB_USART_ReceiverAddressIsReceived(USART_MODULE_ID index)
bool PLIB_SPI_ExistsCommunicationWidth(SPI_MODULE_ID index)
static void Package_Manchester(void)
uint8_t numTrfsSmPolled
Definition: inszt_adc.c:26587
DRV_SPI_CLOCK_MODE clockMode
Definition: inszt_adc.c:26576
void PLIB_DMA_CRCDataWrite(DMA_MODULE_ID index, uint32_t DMACRCdata)
uint16_t crc
Definition: commands.h:75
static void DRV_TMR3_Close(void)
bool PLIB_SPI_TransmitUnderRunStatusGet(SPI_MODULE_ID index)
uint32_t PLIB_DMA_ChannelXDestinationStartAddressGet(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel)
TMR_PRESCALE DRV_TMR2_PrescalerGet(void)
S4_COMMAND
Definition: inszt_app.c:27708
bool PLIB_USART_ExistsTransmitterEmptyStatus(USART_MODULE_ID index)
size_t DRV_USART_Read(const DRV_HANDLE handle, void *buffer, const size_t numbytes)
bool PLIB_DMA_SuspendIsEnabled(DMA_MODULE_ID index)
bool PLIB_DMA_ChannelXIsEnabled(DMA_MODULE_ID index, DMA_CHANNEL channel)
void * PLIB_USART_TransmitterAddressGet(USART_MODULE_ID index)
bool PLIB_PORTS_PinChangeNoticeEdgeIsEnabled(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos, PORTS_CHANGE_NOTICE_EDGE cnEdgeType)
SYS_MODULE_OBJ DRV_TMR_Initialize(const SYS_MODULE_INDEX drvIndex, const SYS_MODULE_INIT *const init)
void SYS_PORTS_Set(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_TYPE value, PORTS_DATA_MASK mask)
void PLIB_USART_BaudRateHighDisable(USART_MODULE_ID index)
uint8_t PLIB_USART_AddressGet(USART_MODULE_ID index)
uintptr_t SYS_DMA_CHANNEL_HANDLE
Definition: inszt_adc.c:13249
DMA_CHANNEL PLIB_DMA_CRCChannelGet(DMA_MODULE_ID index)
bool PLIB_USART_ExistsReceiver(USART_MODULE_ID index)
DMA_CRC_BYTE_ORDER PLIB_DMA_CRCByteOrderGet(DMA_MODULE_ID index)
bool PLIB_DMA_ExistsChannelXEvent(DMA_MODULE_ID index)
bool PLIB_PORTS_ExistsPortsWrite(PORTS_MODULE_ID index)
void Set_WL_SPS_CurrentLimit(uint16_t value)
bool PLIB_USART_ReceiverParityErrorHasOccurred(USART_MODULE_ID index)
static COMMAND_STATES CMD_STATES
void(* DRV_SPI_BUFFER_EVENT_HANDLER)(DRV_SPI_BUFFER_EVENT event, DRV_SPI_BUFFER_HANDLE bufferHandle, void *context)
SYS_MODULE_OBJ DRV_USART0_Initialize(void)
static void DRV_TMR1_Tasks(void)
Definition: app.h:59
size_t SYS_DMA_ChannelSourceTransferredSizeGet(SYS_DMA_CHANNEL_HANDLE handle)
static void read_switches(void)
DRV_USART_BAUD_SET_RESULT DRV_USART_BaudSet(const DRV_HANDLE client, uint32_t baud)
DRV_USART_CLIENT_STATUS
DRV_SPI_BUFFER_HANDLE DRV_SPI_BufferAddWriteRead2(DRV_HANDLE handle, void *txBuffer, size_t txSize, void *rxBuffer, size_t rxSize, DRV_SPI_BUFFER_EVENT_HANDLER completeCB, void *context, DRV_SPI_BUFFER_HANDLE *jobHandle)
bool PLIB_PORTS_PinChangeNoticeEdgeHasOccurred(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
void DRV_ADC_Initialize(void)
bool PLIB_DMA_ChannelXTriggerIsEnabled(DMA_MODULE_ID index, DMA_CHANNEL channel, DMA_CHANNEL_TRIGGER_TYPE trigger)
void PLIB_USART_BRGClockSourceSelect(USART_MODULE_ID index, USART_BRG_CLOCK_SOURCE brgClockSource)
void MAN_RX_Tasks(void)
Definition: inszt_man.c:29829
void PLIB_USART_BaudRateHighEnable(USART_MODULE_ID index)
SYS_DMA_CHANNEL_CHAIN_PRIO
void Reset_CRC_Value(void)
Definition: crc.c:141
bool manual_bias_flag
Definition: inszt_app.c:29425
DRV_USART_BUFFER_RESULT
Definition: inszt_adc.c:15118
uint8_t xmit_ready_flag
Definition: fsk.h:128
void PLIB_PORTS_Set(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_TYPE value, PORTS_DATA_MASK mask)
void PLIB_USART_IrDAEnable(USART_MODULE_ID index)
bool PLIB_DMA_ExistsChannelBits(DMA_MODULE_ID index)
void SYS_PORTS_PinWrite(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos, bool value)
INT_SOURCE rxInterruptSource
Definition: inszt_adc.c:26582
MSG_STATES
Definition: fsk.h:145
void DRV_TMR0_Initialize(void)
int16_t PLIB_USART_Receiver9BitsReceive(USART_MODULE_ID index)
void PLIB_SPI_AudioErrorEnable(SPI_MODULE_ID index, SPI_AUDIO_ERROR error)
void PLIB_PORTS_PinDirectionOutputSet(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
PORTS_PIN_INTERRUPT_TYPE
Definition: inszt_adc.c:21903
void DRV_ADC0_Open(void)
void PLIB_DMA_CRCAppendModeDisable(DMA_MODULE_ID index)
Definition: cf.h:91
uint8_t count
Definition: inszt_man.c:29594
uint16_t PLIB_DMA_ChannelXStartAddressOffsetGet(DMA_MODULE_ID index, DMA_CHANNEL channel, DMA_ADDRESS_OFFSET_TYPE offset)
DRV_TMR_OPERATION_MODE DRV_TMR_OperationModeGet(DRV_HANDLE handle)
bool spi_sent_flag
Definition: inszt_app.c:28651
void DRV_IC_Stop(DRV_HANDLE handle)
DMA_CHANNEL_TRANSFER_DIRECTION PLIB_DMA_ChannelXTransferDirectionGet(DMA_MODULE_ID index, DMA_CHANNEL channel)
PORTS_DATA_TYPE PLIB_PORTS_ReadLatched(PORTS_MODULE_ID index, PORTS_CHANNEL channel)
void PLIB_USART_HandshakeModeSelect(USART_MODULE_ID index, USART_HANDSHAKE_MODE handshakeConfig)
static void Flush_Buffer_Manchester(void)
void DRV_TMR_Close(DRV_HANDLE handle)
void PLIB_SPI_StopInIdleEnable(SPI_MODULE_ID index)
void PLIB_USART_TransmitterEnable(USART_MODULE_ID index)
void PLIB_DMA_CRCPolynomialLengthSet(DMA_MODULE_ID index, uint8_t polyLength)
bool PLIB_USART_ExistsTransmitterIdleIsLow(USART_MODULE_ID index)
void PLIB_DMA_ChannelXCellSizeSet(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel, uint16_t CellSize)
void PLIB_PORTS_PinWrite(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos, bool value)
MAN_RX_STATES
Definition: inszt_app.c:29370
bool DRV_TMR_AlarmRegister(DRV_HANDLE handle, uint32_t divider, bool isPeriodic, uintptr_t context, DRV_TMR_CALLBACK callBack)
bool PLIB_USART_ExistsWakeOnStart(USART_MODULE_ID index)
bool PLIB_SPI_ExistsBusStatus(SPI_MODULE_ID index)
bool PLIB_PORTS_ExistsChangeNotice(PORTS_MODULE_ID index)
uint32_t DRV_TMR3_PeriodValueGet(void)
bool PLIB_DMA_ExistsChannelXPriority(DMA_MODULE_ID index)
void SYS_PORTS_ChangeNotificationGlobalDisable(PORTS_MODULE_ID index)
void(* DRV_USART_BUFFER_EVENT_HANDLER)(DRV_USART_BUFFER_EVENT event, DRV_USART_BUFFER_HANDLE bufferHandle, uintptr_t context)
int qqupload_registered
Definition: inszt_main.c:6760
void DRV_SPI_Deinitialize(SYS_MODULE_OBJ object)
void PLIB_DMA_ChannelXDisabledDisablesEvents(DMA_MODULE_ID index, DMA_CHANNEL channel)
SYS_STATUS DRV_USART_Status(SYS_MODULE_OBJ object)
bool PLIB_USART_ExistsTransmitterBufferFullStatus(USART_MODULE_ID index)
DRV_USART_LINE_CONTROL_SET_RESULT DRV_USART0_LineControlSet(DRV_USART_LINE_CONTROL lineControlMode)
INT_SOURCE errInterruptSource
Definition: inszt_adc.c:26584
DRV_TMR_CLK_SOURCES
Definition: inszt_adc.c:1694
void DRV_PMP0_Initialize(void)
void PLIB_PORTS_ChangeNoticePullDownPerPortDisable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
bool PLIB_SPI_ExistsSlaveSelectControl(SPI_MODULE_ID index)
COMM_DATA COMM
Definition: commmodule.c:58
DRV_TMR_CLIENT_STATUS DRV_TMR1_ClientStatus(void)
void PLIB_DMA_SuspendEnable(DMA_MODULE_ID index)
bool PLIB_DMA_ExistsLastBusAccess(DMA_MODULE_ID index)
ldra_void_function qqqaccumreset[QQQnumfil]
Definition: inszt_main.c:154
bool sw_status_bit_check
Definition: commands.h:81
bool PLIB_DMA_ExistsChannelXPatternLength(DMA_MODULE_ID index)
void PLIB_USART_ReceiverIdleStateLowEnable(USART_MODULE_ID index)
void PLIB_DMA_ChannelXTriggerDisable(DMA_MODULE_ID index, DMA_CHANNEL channel, DMA_CHANNEL_TRIGGER_TYPE trigger)
static SYS_STATUS DRV_TMR1_Status(void)
static int commands_65zqzqzq(int qqqi)
void SYS_PORTS_PinToggle(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
void PLIB_USART_StopInIdleDisable(USART_MODULE_ID index)
bool PLIB_SPI_ExistsInputSamplePhase(SPI_MODULE_ID index)
bool PLIB_DMA_CRCIsEnabled(DMA_MODULE_ID index)
void PLIB_SPI_BufferWrite16bit(SPI_MODULE_ID index, uint16_t data)
static void DRV_TMR3_Tasks(void)
uint16_t PLIB_DMA_ChannelXCellSizeGet(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel)
bool SYS_DMA_ChannelIsBusy(SYS_DMA_CHANNEL_HANDLE handle)
bool PLIB_PORTS_ExistsChangeNoticeEdgeStatus(PORTS_MODULE_ID index)
uint16_t current
Definition: inszt_app.c:28456
unsigned char uchar8_t
bool DRV_TMR_GateModeClear(DRV_HANDLE handle)
bool PLIB_DMA_ExistsChannelXChain(DMA_MODULE_ID index)
uint32_t DRV_TMR4_CounterValueGet(void)
DRV_SPI_MODE spiMode
Definition: inszt_adc.c:26541
bool DRV_USART_ReceiverBufferIsEmpty(const DRV_HANDLE handle)
bool PLIB_SPI_ExistsAudioCommunicationWidth(SPI_MODULE_ID index)
bool PLIB_DMA_ExistsEnableControl(DMA_MODULE_ID index)
static void qqqbitmapreset(qqnull_params)
COMMAND_DATA CMD
DRV_TMR_OPERATION_MODE DRV_TMR3_DividerRangeGet(DRV_TMR_DIVIDER_RANGE *pDivRange)
FSK_STATES
Definition: fsk.h:53
void PLIB_PORTS_ChangeNoticeInIdleDisable(PORTS_MODULE_ID index)
void DRV_TMR3_CounterValueSet(uint32_t value)
uint16_t voltage
Definition: inszt_app.c:28639
void PLIB_PORTS_CnPinsDisable(PORTS_MODULE_ID index, PORTS_CN_PIN cnPins)
bool PLIB_SPI_Exists32bitBuffer(SPI_MODULE_ID index)
static void ValidateComm(void)
void PLIB_PORTS_PinClear(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
uint8_t PLIB_DMA_CRCPolynomialLengthGet(DMA_MODULE_ID index)
static void qqqupload(qqnull_params)
DRV_USART_OPERATION_MODE
void PLIB_SPI_ErrorInterruptEnable(SPI_MODULE_ID index, SPI_ERROR_INTERRUPT error)
void SYS_PORTS_PinSet(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
bool PLIB_SPI_ExistsAudioProtocolControl(SPI_MODULE_ID index)
DMA_TRANSFER_MODE PLIB_DMA_ChannelXOperatingTransferModeGet(DMA_MODULE_ID index, DMA_CHANNEL channel)
SYS_PORTS_PIN_DIRECTION
bool PLIB_SPI_ExistsFIFOInterruptMode(SPI_MODULE_ID index)
DRV_SPI_TASK_MODE taskMode
Definition: inszt_adc.c:26539
SWITCH_DATA SWITCH
Definition: switches.c:59
DRV_TMR_CLIENT_STATUS DRV_TMR2_ClientStatus(void)
void PLIB_DMA_CRCXOREnableSet(DMA_MODULE_ID index, uint32_t DMACRCXOREnableMask)
void PLIB_DMA_ChannelXAddressModeSelect(DMA_MODULE_ID index, DMA_CHANNEL channel, DMA_CHANNEL_ADDRESSING_MODE channelAddressMode)
void PLIB_PORTS_Clear(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_MASK clearMask)
bool DRV_TMR1_ClockSet(DRV_TMR_CLK_SOURCES clockSource, TMR_PRESCALE prescale)
bool PLIB_DMA_ExistsChannelXSourcePointer(DMA_MODULE_ID index)
void SYS_PORTS_Write(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_TYPE value)
bool PLIB_USART_ExistsTransmitter(USART_MODULE_ID index)
void PLIB_PORTS_ChangeNoticeInIdleEnable(PORTS_MODULE_ID index)
void CF_Tasks(void)
Definition: cf.c:80
SYS_STATUS DRV_USART0_Status(void)
PORTS_DATA_MASK SYS_PORTS_DirectionGet(PORTS_MODULE_ID index, PORTS_CHANNEL channel)
void Clear_Status(uint8_t bitposn)
static void DRV_TMR0_Close(void)
bool PLIB_DMA_ExistsStopInIdle(DMA_MODULE_ID index)
bool process_complete_flag
Definition: commands.h:79
bool PLIB_DMA_ExistsChannelXDestinationStartAddress(DMA_MODULE_ID index)
void PLIB_USART_Transmitter9BitsSend(USART_MODULE_ID index, int8_t data, bool Bit9th)
bool PLIB_USART_ExistsOperationMode(USART_MODULE_ID index)
#define FILEPOINT
uint8_t PLIB_DMA_ChannelBitsGet(DMA_MODULE_ID index)
DRV_TMR_CLIENT_STATUS
bool PLIB_DMA_ChannelXPatternIgnoreByteIsEnabled(DMA_MODULE_ID index, DMA_CHANNEL channel)
void Set_Bias(uint8_t value)
Definition: inszt_man.c:30592
bool PLIB_USART_ReceiverOverrunHasOccurred(USART_MODULE_ID index)
bool PLIB_SPI_ExistsFrameSyncPulseDirection(SPI_MODULE_ID index)
bool PLIB_DMA_ChannelXBusyIsBusy(DMA_MODULE_ID index, DMA_CHANNEL channel)
bool b_command_complete_flag
Definition: commands.h:80
void PLIB_SPI_FrameSyncPulseWidthSelect(SPI_MODULE_ID index, SPI_FRAME_PULSE_WIDTH width)
bool PLIB_USART_ExistsRunInOverflow(USART_MODULE_ID index)
void SYS_DMA_Resume(void)
void PLIB_DMA_ChannelXTransferCountSet(DMA_MODULE_ID index, DMA_CHANNEL channel, uint16_t transferCount)
DMA_CHANNEL_PRIORITY PLIB_DMA_ChannelXPriorityGet(DMA_MODULE_ID index, DMA_CHANNEL channel)
uint32_t SYS_DMA_ChannelCRCGet(void)
void PLIB_SPI_AudioErrorDisable(SPI_MODULE_ID index, SPI_AUDIO_ERROR error)
bool PLIB_DMA_ChannelXINTSourceFlagGet(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel, DMA_INT_TYPE dmaINTSource)
void PLIB_PORTS_PinChangeNoticeDisable(PORTS_MODULE_ID index, PORTS_CHANGE_NOTICE_PIN pinNum)
void PLIB_DMA_StartTransferSet(DMA_MODULE_ID index, DMA_CHANNEL channel)
uintptr_t SYS_DMA_CHANNEL_HANDLE
DRV_USART_ERROR
void DRV_TMR1_Initialize(void)
bool PLIB_DMA_ExistsChannelXINTSourceFlag(DMA_MODULE_ID index)
bool PLIB_SPI_ExistsReceiverOverflow(SPI_MODULE_ID index)
void DRV_TMR4_StopInIdleEnable(void)
uint32_t DRV_TMR2_CounterFrequencyGet(void)
TMR_PRESCALE DRV_TMR_PrescalerGet(DRV_HANDLE handle)
bool DRV_TMR_AlarmDisable(DRV_HANDLE handle)
SPI_FRAME_SYNC_PULSE frameSyncPulse
Definition: inszt_adc.c:26549
bool DRV_USART_TransmitBufferIsFull(const DRV_HANDLE handle)
void DRV_USART0_TasksReceive(void)
bool PLIB_DMA_ExistsCRCWriteByteOrder(DMA_MODULE_ID index)
bool PLIB_DMA_IsBusy(DMA_MODULE_ID index)
void PLIB_USART_ReceiverIdleStateLowDisable(USART_MODULE_ID index)
bool PLIB_SPI_ExistsReadDataSignStatus(SPI_MODULE_ID index)
void PLIB_USART_ReceiverAddressAutoDetectDisable(USART_MODULE_ID index)
void SYS_PORTS_PinOpenDrainDisable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
bool PLIB_SPI_ReceiverBufferIsFull(SPI_MODULE_ID index)
void PLIB_PORTS_PinChangeNoticePerPortDisable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
void PLIB_DMA_ChannelXPatternLengthSet(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel, DMA_PATTERN_LENGTH patternLen)
static int commands_65zqendz(int qqqi)
void Set_HVPS_Ramp_Rate(uint16_t value)
Definition: hvps.c:89
bool PLIB_SPI_ExistsMasterControl(SPI_MODULE_ID index)
void SYS_PORTS_PinOpenDrainEnable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
bool PLIB_DMA_ExistsChannelXCellSize(DMA_MODULE_ID index)
SYS_DMA_TRANSFER_EVENT
Definition: inszt_adc.c:13469
WL_SPS_STATES
void DRV_TMR4_Stop(void)
DRV_TMR_OPERATION_MODE DRV_TMR2_DividerRangeGet(DRV_TMR_DIVIDER_RANGE *pDivRange)
void PLIB_PORTS_PinSet(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
void SYS_DMA_ChannelForceStart(SYS_DMA_CHANNEL_HANDLE handle)
uint32_t DRV_TMR_AlarmHasElapsed(DRV_HANDLE handle)
bool PLIB_PORTS_ExistsChangeNoticePullUp(PORTS_MODULE_ID index)
S5_COMMAND
Definition: inszt_app.c:27754
S4_COMMAND
DRV_TMR_OPERATION_MODE
void PLIB_DMA_ChannelXChainDisable(DMA_MODULE_ID index, DMA_CHANNEL channel)
void PLIB_DMA_CRCDisable(DMA_MODULE_ID index)
void PLIB_PORTS_ChannelChangeNoticePullDownEnable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_MASK mask)
int QQQfcn_ptr_num
Definition: inszt_main.c:151
bool PLIB_SPI_ExistsStopInIdleControl(SPI_MODULE_ID index)